Jump to content
Not connected, Your IP: 3.144.90.108
Sign in to follow this  
Flex

ANSWERED System GUI BusyBox Script to change date on Tomato Routers

Recommended Posts

echo "###############System GUI BusyBox Script to change date on Tomato Routers####################"

echo "###TESTED on ASUS RT-N16 Tomato firmware->Tomato Firmware v1.28.9054 MIPSR2-beta K26 USB vpn3.6###"

echo "###Change ONLY the following variables-> newyear newmonth newday newday newhh newmm newss###"

echo "###to your own timezone###"

#variables need to be set to own timezone

newyear=2013

newmonth=09

newday=23

newhh=4

newmm=25

newss=00

#End of change variables#

#change presentyear if presentyear=2014 accordingly

presentyear=2013

#don't change the newsetdate

newsetdate=`date -s $newyear.$newmonth.$newday-$newhh:$newmm:$newss`

#ryear=1969

#days of week vars

d1="Mon"

d2="Tue"

d3="Wed"

d4="Thu"

d5="Fri"

d6="Sat"

d7="Sun"

#months of year

m1="Jan"

m2="Feb"

m3="Mar"

m4="Apr"

m5="May"

m6="Jun"

m7="Jul"

m8="Aug"

m9="Sep"

m10="Oct"

m11="Nov"

m12="Dec"

#reset day don't change

rday=31

echo "###Tomato Router sometimes will reset the date to: $m12 $rday. resulting in error=certificate is not yet valid:"

echo "###VPN client will NOT work anymore. Therefore the date needs to be reset to current time/timezone."

currenty=`date | cut -c25-30`

currentm=`date | cut -c5-7`

currentd=`date | cut -c9-10`

cd=`date | cut -c1-3`

chhmmss=`date | cut -c12-19`

#more date details

echo Tomato Router Date Details:

echo "-------------------------------------------"

#check year

if [ $currenty -gt $presentyear ]

then

echo Current year is : IN THE FUTURE 

elif [ $currenty -lt $presentyear ]

then

echo Current year is: IN THE PAST

else

echo Current year is: $currenty 

fi

#check month -don't change

if [ $currentm == $m1 ] 

then

echo Current month is: $m1

elif [ $currentm == $m2 ]

then

echo Current month is: $m2

elif [ $currentm == $m3 ]

then

echo Current month is: $m3

elif [ $currentm == $m4 ]

then

echo Current month is: $m4

elif [ $currentm == $m5 ]

then

echo Current month is: $m5

elif [ $currentm == $m6 ]

then

echo Current month is: $m6

elif [ $currentm == $m7 ]

then

echo Current month is: $m7

elif [ $currentm == $m8 ]

then

echo Current month is: $m8

elif [ $currentm == $m9 ]

then

echo Current month is: $m9

elif [ $currentm == $m10 ]

then

echo Current month is: $m10

elif [ $currentm == $m11 ]

then

echo Current month is: $m11

elif [ $currentm == $m12 ]

then

echo Current month is: $m12

else

echo Current month has changed to: $currentm

fi

#check day of the month - don't change

if [ $currentd == $rday ]

then

echo Current day has changed to: $rday

else

echo Current day is: $currentd

fi

#check day of the week

if [ $cd == $d1 ] 

then

echo Current Day of the week is: $d1

elif [ $cd == $d2 ]

then

echo Current Day of the week is: $d2

elif [ $currentm == $d3 ]

then

echo Current Day of the week is: $d3

elif [ $cd == $d4 ]

then

echo Day of the week is: $d4

elif [ $cd == $d5 ]

then

echo Current Day of the week is: $d5

elif [ $cd == $d6 ]

then

echo Current Day of the week is: $d6

elif [ $cd == $d7 ]

then

echo Current Day of the week is: $d7

else

echo Day of the week changed to: $cd

fi

echo "Current time is: $chhmmss hh:mm:ss"

echo "-------------------------------------------"

#new date validation/apply -don't change

if [ "$newsetdate" != " " ]

then

echo New DATE settings APPLIED: $newsetdate

else

echo New DATE settings NOT applied!

fi

echo "###TESTED on ASUS RT-N16 Tomato firmware->Tomato Firmware v1.28.9054 MIPSR2-beta K26 USB vpn3.6###"

echo "###############System GUI BusyBox Script to change date on Tomato Routers####################"

Share this post


Link to post

 

echo "---===COPY/PASTE WHOLE SCRIPT/TEXT IN TOMATO ROUTER GUI->Tools->System->click Execute===---"
c=`/bin/busybox --help |head -2|tail -1 |cut -c1-14`
vtop=`/bin/busybox --help | head -1`
echo "###############System GUI BusyBox 1.17.x Script####################"
echo "############PURPOSE:Change TIMEZONE on Tomato Routers!############"
echo "Tomato Router Operating System/Details:"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" 
echo "$vtop"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "###INSTRUCTIONS:Change ONLY the following variables-->>newyear newmonth newday newhh newmm newss###"
echo "------>to your own timezone/location<------IF YOU HAVE NOT DONE SO ALREADY!!!"
#IMPORTANT:variables below need to be set to own timezone/location
newyear=2013
newmonth=09
newday=24
newhh=10
newmm=41
newss=00
#NOTE:ONLY change presentyear below if presentyear shifted (e.g. 2014 2015)
presentyear=2013
echo "###INSTRUCTIONS:AFTER THE variables HAVE BEEN CHANGED TO NEW CURRENT VALUES WE PROCEED-->>"
echo " "
#End of change variables
#the newsetdate -don't change 
newsetdate=`date -s $newyear.$newmonth.$newday-$newhh:$newmm:$newss`
#reset year -don't change
ryear=1969
#days of week vars -don't change
d1="Mon"
d2="Tue"
d3="Wed"
d4="Thu"
d5="Fri"
d6="Sat"
d7="Sun"
#months of year vars -don't change
m1="Jan"
m2="Feb"
m3="Mar"
m4="Apr"
m5="May"
m6="Jun"
m7="Jul"
m8="Aug"
m9="Sep"
m10="Oct"
m11="Nov"
m12="Dec"
#reset day -don't change
rday=31
currenty=`date | cut -c25-30`
currentm=`date | cut -c5-7`
currentd=`date | cut -c9-10`
cd=`date | cut -c1-3`
chhmmss=`date | cut -c12-19`
echo "###Tomato Routers sometimes WILL reset the date to: $d3 $m12 $rday $ryear resulting in-->>error=certificate is not yet valid:<<--"
echo "###Due to the above ERROR->VPN client1/client2 will NOT function/work anymore." 
echo "###To make the VPN client1/client2 connect again the date/timezone on the ROUTER needs to be reset to current time/timezone."
#some details
echo "Tomato Router Date Details:"
echo "-------------------------------------------"
#check year -don't change
if [ $currenty -gt $presentyear ]
then
echo "Current year is: IN THE FUTURE" 
elif [ $currenty -lt $presentyear ]
then
echo "Current year is: IN THE PAST"
else
echo "Current year is: $currenty" 
fi
#check month -don't change
if [ $currentm == $m1 ] 
then
echo "Current month is: $m1"
elif [ $currentm == $m2 ]
then
echo "Current month is: $m2"
elif [ $currentm == $m3 ]
then
echo "Current month is: $m3"
elif [ $currentm == $m4 ]
then
echo "Current month is: $m4"
elif [ $currentm == $m5 ]
then
echo "Current month is: $m5"
elif [ $currentm == $m6 ]
then
echo "Current month is: $m6"
elif [ $currentm == $m7 ]
then
echo "Current month is: $m7"
elif [ $currentm == $m8 ]
then
echo "Current month is: $m8"
elif [ $currentm == $m9 ]
then
echo "Current month is: $m9"
elif [ $currentm == $m10 ]
then
echo "Current month is: $m10"
elif [ $currentm == $m11 ]
then
echo "Current month is: $m11"
elif [ $currentm == $m12 ]
then
echo "Current month is: $m12"
else
echo "Current month has changed to: $currentm"
fi
#check day of the month -don't change
if [ $currentd == $rday ]
then
echo "Current day has changed to: $rday"
else
echo "Current day is: $currentd"
fi
#check day of the week -don't change
if [ $cd == $d1 ] 
then
echo "Current Day of the week is: $d1"
elif [ $cd == $d2 ]
then
echo "Current Day of the week is: $d2"
elif [ $currentm == $d3 ]
then
echo "Current Day of the week is: $d3"
elif [ $cd == $d4 ]
then
echo "Current Day of the week is: $d4"
elif [ $cd == $d5 ]
then
echo "Current Day of the week is: $d5"
elif [ $cd == $d6 ]
then
echo "Current Day of the week is: $d6"
elif [ $cd == $d7 ]
then
echo "Current Day of the week is: $d7"
else
echo "Current Day of the week is: $cd"
fi
#check time/display -don't change
if [ "$chhmmss" != " " ]
then
echo "Current time is: $chhmmss hh:mm:ss"
else
echo "Current time is: NOT DEFINED!"
fi
echo "-------------------------------------------"
#new date validation/apply -don't change
if [ "$newsetdate" != " " ]
then
echo "New DATE settings APPLIED: $newsetdate"
else
echo "New DATE settings NOT applied!"
fi
echo "###TESTED on ASUS RT-N16 Tomato firmware->Tomato Firmware v1.28.9054 MIPSR2-beta K26 USB vpn3.6###"
echo "$c Flexon"

 

NOTE*** TO TOMATO USERS--> DISABLE AUTO-UPDATE TIME IN TOMATO ROUTER GUI

NOTE TO STAFF*** POST THIS UPDATED VERSION OF THE PREVIOUS SCRIPT

Regards,

Flex

 

 

 

Share this post


Link to post

There is a little glitch in the if #day of the week checking section. It still works and does the intended job. I looked all over the web for a solution how to change the timezone on tomato routers. The one line date -s etc.etc.etc.etc does it but the hour shifts -1 for some odd reason. So I created my own script aka what you see posted here. Now I've corrected it....

Regards.

 

#---START----OF---TOMATO-ROUTER-EASY-CHANGE-TIMEZONE-SCRIPT---------------
#set the new year for the tomato router 
newyear=2013
#set the new month for the tomato router
newmonth=09
#set the new day for the tomato router
newday=28
#set the new hour for the tomato router
newhh=12
#set the new minute for the tomato router
newmm=41
#set the seconds for the tomato router
newss=00
echo "Tomato Router Operating System/Details:"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
c=`/bin/busybox --help |head -2|tail -1 |cut -c1-14`
vtop=`/bin/busybox --help | head -1`
echo "$vtop"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "###INSTRUCTIONS:Change ONLY the following variables-->>newyear newmonth newday newhh newmm newss###"
echo "------>to your own timezone/location<------IF YOU HAVE NOT DONE SO ALREADY!!!" 
#NOTE:ONLY change presentyear* below if presentyear shifted (e.g. 2014 2015)
presentyear=2013
echo "###INSTRUCTIONS:AFTER THE variables HAVE BEEN CHANGED TO NEW CURRENT VALUES WE PROCEED-->>"
echo " "
#End of change variables
#the newsetdate -don't change 
newsetdate=`date -s $newyear.$newmonth.$newday-$newhh:$newmm:$newss`
#reset year -don't change
ryear=1969
#days of week vars -don't change
d1="Mon"
d2="Tue"
d3="Wed"
d4="Thu"
d5="Fri"
d6="Sat"
d7="Sun"
#months of year vars -don't change
m1="Jan"
m2="Feb"
m3="Mar"
m4="Apr"
m5="May"
m6="Jun"
m7="Jul"
m8="Aug"
m9="Sep"
m10="Oct"
m11="Nov"
m12="Dec"
#reset day -don't change
rday=31
currenty=`date | cut -c25-30`
currentm=`date | cut -c5-7`
currentd=`date | cut -c9-10`
cd=`date | cut -c1-3`
chhmmss=`date | cut -c12-19`
echo "###Tomato Routers sometimes WILL reset the date to: $d3 $m12 $rday $ryear resulting in-->>error=certificate is not yet valid:<<--"
echo "###Due to the above ERROR->VPN client1/client2 will NOT function/work anymore." 
echo "###To make the VPN client1/client2 connect again the date/timezone on the ROUTER needs to be reset to current time/timezone."
#some details
echo "Tomato Router Date Details:"
echo "-------------------------------------------"
#check year -don't change
if [ $currenty -gt $presentyear ]
then
echo "Current year is: IN THE FUTURE" 
elif [ $currenty -lt $presentyear ]
then
echo "Current year is: IN THE PAST"
else
echo "Current year is: $currenty" 
fi
#check month -don't change
if [ $currentm == $m1 ] 
then
echo "Current month is: $m1"
elif [ $currentm == $m2 ]
then
echo "Current month is: $m2"
elif [ $currentm == $m3 ]
then
echo "Current month is: $m3"
elif [ $currentm == $m4 ]
then
echo "Current month is: $m4"
elif [ $currentm == $m5 ]
then
echo "Current month is: $m5"
elif [ $currentm == $m6 ]
then
echo "Current month is: $m6"
elif [ $currentm == $m7 ]
then
echo "Current month is: $m7"
elif [ $currentm == $m8 ]
then
echo "Current month is: $m8"
elif [ $currentm == $m9 ]
then
echo "Current month is: $m9"
elif [ $currentm == $m10 ]
then
echo "Current month is: $m10"
elif [ $currentm == $m11 ]
then
echo "Current month is: $m11"
elif [ $currentm == $m12 ]
then
echo "Current month is: $m12"
else
echo "Current month has changed to: $currentm"
fi
#check day of the month -don't change
if [ $currentd == $rday ]
then
echo "Current day has changed to: $rday"
else
echo "Current day is: $currentd"
fi
#check day of the week -don't change
if [ $cd == $d1 ] 
then
echo "Current Day of the week is: $d1"
elif [ $cd == $d2 ]

 

 

then
echo "Current Day of the week is: $d2"
#elif [ $currentm == $d3 ]
elif [ $cd == $d3 ]
then
echo "Current Day of the week is: $d3"
elif [ $cd == $d4 ]
then
echo "Current Day of the week is: $d4"
elif [ $cd == $d5 ]
then
echo "Current Day of the week is: $d5"
elif [ $cd == $d6 ]
then
echo "Current Day of the week is: $d6"
elif [ $cd == $d7 ]
then
echo "Current Day of the week is: $d7"
else
echo "Current Day of the week is: $cd"
fi
#check time/display -don't change
if [ "$chhmmss" != " " ]
then
echo "Current time is: $chhmmss hh:mm:ss"
else
echo "Current time is: UNKNOWN!"
fi
echo "-------------------------------------------"
#new date validation/apply -don't change
if [ "$newsetdate" != " " ]
then
echo "New DATE settings APPLIED: $newsetdate"
else
echo "New DATE settings NOT applied!"
fi
echo "###TESTED on ASUS RT-N16 Tomato firmware->Tomato Firmware v1.28.9054 MIPSR2-beta K26 USB vpn3.6###"
echo "$c Flexon"
#---END----OF---TOMATO-ROUTER-EASY-CHANGE-TIMEZONE-SCRIPT---------------
 

 

 

Share this post


Link to post
Hello,
*NOTE to  ADMINS and MODS-> THIS is the last time I submit this script that also checks the hour->morning/afternoon/evening.. as other members have shown interest.
CARE TO EXPLAIN ... WHAT IS SO WRONG WITH THIS SCRIPT BELOW?

 

#---TOMATO-ROUTER-EASY-CHANGE-TIMEZONE-SCRIPT---------------
#could have made it shorter but I prefer something that works #even if it's longer and lots of if/elif/else are used.
echo "###INSTRUCTIONS:Change ONLY the following variables-->>newyear newmonth newday newhh newmm newss###"
#set the new year for the tomato router 
newyear=2013
#set the new month for the tomato router
newmonth=09
#set the new day for the tomato router
newday=28
#set the new hour for the tomato router
newhh=12
#set the new minute for the tomato router
newmm=41
#set the seconds for the tomato router
newss=00
#NOTE:ONLY change presentyear var below if presentyear shifted (e.g. 2014 2015)
presentyear=2013
#reset year -don't change
ryear=1969
#reset day -don't change
rday=31
echo "Tomato Router Operating System/Details:"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
c=`/bin/busybox --help |head -2|tail -1 |cut -c1-14`
vtop=`/bin/busybox --help | head -1`
echo "$vtop"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "------>to your own timezone/location<------IF YOU HAVE NOT DONE SO ALREADY!!!" 
echo "###INSTRUCTIONS:AFTER THE variables HAVE BEEN CHANGED TO NEW CURRENT VALUES WE CONTINUE ON....."
echo " "
#End of change variables
#the newsetdate -don't change 
newsetdate=`date -s $newyear.$newmonth.$newday-$newhh:$newmm:$newss`
#days of week vars -don't change
d1="Mon"
d2="Tue"
d3="Wed"
d4="Thu"
d5="Fri"
d6="Sat"
d7="Sun"
#months of year vars -don't change
m1="Jan"
m2="Feb"
m3="Mar"
m4="Apr"
m5="May"
m6="Jun"
m7="Jul"
m8="Aug"
m9="Sep"
m10="Oct"
m11="Nov"
m12="Dec"
 
currenty=`date | cut -c25-30`
currentm=`date | cut -c5-7`
currentd=`date | cut -c9-10`
cd=`date | cut -c1-3`
chhmmss=`date | cut -c12-19`
chh=`date | cut -c12-19 | cut -c1-2`
cmm=`date | cut -c12-19 | cut -c4-5`
css=`date | cut -c12-19 | cut -c7-8`
echo "###Tomato Routers sometimes AFTER A REBOOT WILL reset the date to: $d3 $m12 $rday $ryear resulting in-->>error=certificate is not yet valid:<<--"
echo "###Due to the above ERROR->VPN client1/client2 will NOT function/work anymore." 
echo "###To make the VPN client1/client2 connect again the date/timezone on the ROUTER needs to be reset to current time/timezone."
#some details
echo "Tomato Router Date Details:"
echo "-------------------------------------------"
#check year -don't change
if [ $currenty -gt $presentyear ]
then
echo "ROUTER Current year is: IN THE FUTURE" 
elif [ $currenty -lt $presentyear ]
then
echo "ROUTER Current year is: IN THE PAST"
else
echo "ROUTER Current year is: $currenty" 
fi
#check month -don't change
if [ $currentm == $m1 ] 
then
echo "ROUTER Current month is: $m1"
elif [ $currentm == $m2 ]
then
echo "ROUTER Current month is: $m2"
elif [ $currentm == $m3 ]
then
echo "ROUTER Current month is: $m3"
elif [ $currentm == $m4 ]
then
echo "ROUTER Current month is: $m4"
elif [ $currentm == $m5 ]
then
echo "ROUTER Current month is: $m5"
elif [ $currentm == $m6 ]
then
echo "ROUTER Current month is: $m6"
elif [ $currentm == $m7 ]
then
echo "ROUTER Current month is: $m7"
elif [ $currentm == $m8 ]
then
echo "ROUTER Current month is: $m8"
elif [ $currentm == $m9 ]
then
echo "ROUTER Current month is: $m9"
elif [ $currentm == $m10 ]
then
echo "ROUTER Current month is: $m10"
elif [ $currentm == $m11 ]
then
echo "ROUTER Current month is: $m11"
elif [ $currentm == $m12 ]
then
echo "ROUTER Current month is: $m12"
else
echo "ROUTER Current month has changed to: $currentm"
fi
#check day of the month -don't change
if [ $currentd == $rday ]
then
echo "ROUTER Current day has changed to: $rday"
else
echo "ROUTER Current day is: $currentd"
fi
#check day of the week -don't change
if [ $cd == $d1 ] 
then
echo "ROUTER Current Day of the week is: $d1"
elif [ $cd == $d2 ]
then
echo "ROUTER Current Day of the week is: $d2"
elif [ $cd == $d3 ]
then
echo "ROUTER Current Day of the week is: $d3"
elif [ $cd == $d4 ]
then
echo "ROUTER Current Day of the week is: $d4"
elif [ $cd == $d5 ]
then
echo "ROUTER Current Day of the week is: $d5"
elif [ $cd == $d6 ]
then
echo "ROUTER Current Day of the week is: $d6"
elif [ $cd == $d7 ]
then
echo "ROUTER Current Day of the week is: $d7"
else
echo "ROUTER Current Day of the week is: $cd"
fi
#check time/display -don't change
if [ "$chhmmss" != " " ]
then
#check hour has been included -don't change
if [ "$chh" -ge 0 -a  "$chh" -le 11 ]
then
echo "ROUTER Current time is: $chh:$cmm:$css hh:mm:ss IN THE MORNING!"
else
if [ "$chh" -ge 12 -a  "$chh" -le 17 ]
then
echo "ROUTER Current time is: $chh:$cmm:$css hh:mm:ss IN THE AFTERNOON!"
else
echo "ROUTER Current time is: $chh:$cmm:$css hh:mm:ss IN THE EVENING!"
fi
fi
else
echo "ROUTER Current time is: UNKNOWN!"
fi
echo "-------------------------------------------"
#new date validation/apply -don't change
if [ "$newsetdate" != " " ]
then
echo "New DATE settings APPLIED: $newsetdate"
else
echo "New DATE settings NOT applied!"
fi
echo "###TESTED on ASUS RT-N16 Tomato firmware->Tomato Firmware v1.28.9054 MIPSR2-beta K26 USB vpn3.6###"
#---TOMATO-ROUTER-EASY-CHANGE-TIMEZONE-SCRIPT---------------
Regards

Share this post


Link to post

 

Hello,
*NOTE to  ADMINS and MODS-> THIS is the last time I submit this script that also checks the hour->morning/afternoon/evening.. as other members have shown interest.
CARE TO EXPLAIN ... WHAT IS SO WRONG WITH THIS SCRIPT BELOW?
 
Hello,
 
you have published this script 7 times in different threads. Now it's enough, thank you.
 
Kind regards

Share this post


Link to post
#---TOMATO-ROUTER-EASY-CHANGE-TIMEZONE-SCRIPT---------------

#could have made it shorter but I prefer something that works #even if it's longer and lots of if/elif/else are used.

echo "###INSTRUCTIONS:Change ONLY the following variables-->>newyear newmonth newday newhh newmm newss###"

#set the new year for the tomato router 

newyear=2013

#set the new month for the tomato router

newmonth=09

#set the new day for the tomato router

newday=28

#set the new hour for the tomato router

newhh=12

#set the new minute for the tomato router

newmm=41

#set the seconds for the tomato router

newss=00

#NOTE:ONLY change presentyear var below if presentyear shifted (e.g. 2014 2015)

presentyear=2013

#reset year -don't change

ryear=1969

ryear1=2011

#reset day -don't change

rday=31

echo "Tomato Router Operating System/Details:"

echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

c=`/bin/busybox --help |head -2|tail -1 |cut -c1-14`

vtop=`/bin/busybox --help | head -1`

echo "$vtop"

echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

echo "------>to your own timezone/location<------IF YOU HAVE NOT DONE SO ALREADY!!!" 

echo "###INSTRUCTIONS:AFTER THE variables HAVE BEEN CHANGED TO NEW CURRENT VALUES WE CONTINUE ON....."

echo " "

#End of change variables

#the newsetdate -don't change 

newsetdate=`date -s $newyear.$newmonth.$newday-$newhh:$newmm:$newss`

#days of week vars -don't change

d1="Mon"

d2="Tue"

d3="Wed"

d4="Thu"

d5="Fri"

d6="Sat"

d7="Sun"

#months of year vars -don't change

m1="Jan"

m2="Feb"

m3="Mar"

m4="Apr"

m5="May"

m6="Jun"

m7="Jul"

m8="Aug"

m9="Sep"

m10="Oct"

m11="Nov"

m12="Dec"

 

currenty=`date | cut -c25-30`

currentm=`date | cut -c5-7`

currentd=`date | cut -c9-10`

cd=`date | cut -c1-3`

chhmmss=`date | cut -c12-19`

chh=`date | cut -c12-19 | cut -c1-2`

cmm=`date | cut -c12-19 | cut -c4-5`

css=`date | cut -c12-19 | cut -c7-8`

echo "###FYI aka For your information###"

echo "#Tomato Routers AFTER A REBOOT OR POWER FAILURE  WILL re/set the Router time/date BACK IN TIME to: $d3 $m4 or $m12 $rday $ryear or $ryear1"

echo "#This affects the VPN1 and VPN2 client functionality."

echo "In the GUI->Log->View all-> the resulting in-->>error=certificate is not yet valid:<<--"

echo "#Due to the above so-called 'ERROR'->VPN client1/client2 will NOT work anymore." 

echo "#To make the VPN client1/client2 connect again the date/timezone on the ROUTER needs to be reset to current time/timezone."

#some details

echo "Tomato Router Date Details:"

echo "-------------------------------------------"

#check year -don't change

if [ $currenty -gt $presentyear ]

then

echo "ROUTER Current year is: IN THE FUTURE" 

elif [ $currenty -lt $presentyear ]

then

echo "ROUTER Current year is: IN THE PAST"

else

echo "ROUTER Current year is: $currenty" 

fi

#check month -don't change

if [ $currentm == $m1 ] 

then

echo "ROUTER Current month is: $m1"

elif [ $currentm == $m2 ]

then

echo "ROUTER Current month is: $m2"

elif [ $currentm == $m3 ]

then

echo "ROUTER Current month is: $m3"

elif [ $currentm == $m4 ]

then

echo "ROUTER Current month is: $m4"

elif [ $currentm == $m5 ]

then

echo "ROUTER Current month is: $m5"

elif [ $currentm == $m6 ]

then

echo "ROUTER Current month is: $m6"

elif [ $currentm == $m7 ]

then

echo "ROUTER Current month is: $m7"

elif [ $currentm == $m8 ]

then

echo "ROUTER Current month is: $m8"

elif [ $currentm == $m9 ]

then

echo "ROUTER Current month is: $m9"

elif [ $currentm == $m10 ]

then

echo "ROUTER Current month is: $m10"

elif [ $currentm == $m11 ]

then

echo "ROUTER Current month is: $m11"

elif [ $currentm == $m12 ]

then

echo "ROUTER Current month is: $m12"

else

echo "ROUTER Current month has changed to: $currentm"

fi

#check day of the month -don't change

if [ $currentd == $rday ]

then

echo "ROUTER Current day has changed to: $rday"

else

echo "ROUTER Current day is: $currentd"

fi

#check day of the week -don't change

if [ $cd == $d1 ] 

then

echo "ROUTER Current Day of the week is: $d1"

elif [ $cd == $d2 ]

then

echo "ROUTER Current Day of the week is: $d2"

elif [ $cd == $d3 ]

then

echo "ROUTER Current Day of the week is: $d3"

elif [ $cd == $d4 ]

then

echo "ROUTER Current Day of the week is: $d4"

elif [ $cd == $d5 ]

then

echo "ROUTER Current Day of the week is: $d5"

elif [ $cd == $d6 ]

then

echo "ROUTER Current Day of the week is: $d6"

elif [ $cd == $d7 ]

then

echo "ROUTER Current Day of the week is: $d7"

else

echo "ROUTER Current Day of the week is: $cd"

fi

#check time/display -don't change

if [ "$chhmmss" != " " ]

then

#check hour has been included -don't change

if [ "$chh" -ge 0 -a  "$chh" -le 11 ]

then

echo "ROUTER Current time is: $chh:$cmm:$css hh:mm:ss IN THE MORNING!"

else

if [ "$chh" -ge 12 -a  "$chh" -le 17 ]

then

echo "ROUTER Current time is: $chh:$cmm:$css hh:mm:ss IN THE AFTERNOON!"

else

echo "ROUTER Current time is: $chh:$cmm:$css hh:mm:ss IN THE EVENING!"

fi

fi

else

echo "ROUTER Current time is: UNKNOWN!"

fi

echo "-------------------------------------------"

#new date validation/apply -don't change

if [ "$newsetdate" != " " ]

then

echo "New DATE settings APPLIED: $newsetdate"

else

echo "New DATE settings NOT applied!"

fi

echo "###TESTED on ASUS RT-N16 Tomato firmware->Tomato Firmware v1.28.xx MIPSR2-beta K26 USB vpn3.6/Tomato Firmware 1.28.x.117###"

echo "$c Flexon"

#---TOMATO-ROUTER-EASY-CHANGE-TIMEZONE-SCRIPT---------------

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...