1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom script - automatically change WiFi password

Discussion in 'Tomato Firmware' started by HexImaL, Sep 15, 2007.

  1. HexImaL

    HexImaL LI Guru Member

    Is it possible to change the WiFi password daily, with predefined passwords, for several days ahead? For example,

    Monday, pass0,
    Tuesday, pass1.

    Not sure if it is even "doable" with a script, but thought I'd ask, to make sure. Thanks in advance!
  2. roadkill

    roadkill Super Moderator Staff Member Member

    use nvram get wl_wpa_psk to get the current pass and nvram set wl_wpa_psk=password to set a new one
  3. HexImaL

    HexImaL LI Guru Member

    Thanks for the quick reply, but I have no idea how to implement those in a script that's executed daily? Help or links will be appreciated :)
  4. yaqui

    yaqui LI Guru Member

    Set it up as 7 different crons (one for each day of the week)

    For Sunday:
    cru a sunpass1 "* * * * 0 nvram set wl_wpa_psk=password1"

    For Monday:
    cru a monpass2 "* * * * 1 nvram set wl_wpa_psk=password2"

    For Tuesday:
    cru a tuespass3 "* * * * 2 nvram set wl_wpa_psk=password3"

    etc.... etc...

    You might have to reboot after doing the nvram set though - not sure on that
  5. HexImaL

    HexImaL LI Guru Member

    I understand that 0 is for Sunday, 1 for Monday, etc., but what does sunpass1, monpass2 stand for? For what I understand password1, password2, etc. is where I place the password I want.
  6. roadkill

    roadkill Super Moderator Staff Member Member

    sunpass,monpass etc is the name of the cron job.
    I think think it would be cleaner to have one script which identifies the day and set password accordingly.
  7. yaqui

    yaqui LI Guru Member

    cron has the ability to identify the day on its own.

    But yeah a script would be cleaner... not necessarily more efficient though.

Share This Page