File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed
piratebox_origin/piratebox/piratebox Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change 2727
2828. $1
2929
30- TIMESAVE=" $PIRATEBOX_FOLDER /timesave_file"
3130
3231if [ " $2 " = " install" ] ; then
3332 crontab -l > $PIRATEBOX_FOLDER /tmp/crontab 2> /dev/null
@@ -38,19 +37,10 @@ if [ "$2" = "install" ] ; then
3837 touch $TIMESAVE
3938 chmod a+rw $TIMESAVE
4039
41- if [ " $OPENWRT " = " yes" ] ; then
42- echo " Placing Timerecover on Startup"
43- echo " $0 $1 recover " >> /etc/rc.local
44- sed ' s:exit:#exit:g' -i /etc/rc.local
45- echo " Activating cron-service.."
46- /etc/init.d/cron enable
47- /etc/init.d/cron start
48- echo " done"
49- else
50- echo " Remember to have cron active..."
51- echo " on OpenWrt run: /etc/init.d/cron enable"
52- echo " /etc/init.d/cron start"
53- fi
40+ echo " Remember to have cron active..."
41+ echo " on OpenWrt run: /etc/init.d/cron enable"
42+ echo " /etc/init.d/cron start"
43+
5444 # Save the current time
5545 $0 $1 " save"
5646 exit 0
@@ -70,9 +60,14 @@ if [ "$2" = "save" ] ; then
7060fi
7161
7262if [ " $2 " = " recover" ] ; then
73- date ` cat $TIMESAVE `
74- [ " $? " != " 0" ] && echo " error in recovering time" && exit 255
75- echo " Time recovered"
76- exit 0
63+ if [ ` date +%C%g%m%d%H%M` -lt ` cat $TIMESAVE ` ] ;
64+ date ` cat $TIMESAVE `
65+ [ " $? " != " 0" ] && echo " error in recovering time" && exit 255
66+ echo " Time recovered"
67+ exit 0
68+ else
69+ echo " Sorry, changing timebackward via timesave is not possible"
70+ exit 1
71+ fi
7772fi
7873
Original file line number Diff line number Diff line change 77## 2012-06-08 Changed IP Stuff to generating dnsmasq.conf stuff
88## ADDed SubConfig for IPV6 config
99## Changed Order of config
10+ ## 2013-08-14 Added timesave url
1011##
1112########
1213
@@ -110,6 +111,8 @@ IP=$NET.$IP_SHORT
110111#----------------- Configuration for the pure piratebox -------------------#
111112## droopy, webserver, shoutbox- and forum-server
112113
114+ ## Timesave file for non RTC devices
115+ TIMESAVE="$PIRATEBOX_FOLDER/share/timesave_file"
113116
114117#Start droopy? - Enable upload?
115118DROOPY_ENABLED="yes"
You can’t perform that action at this time.
0 commit comments