Skip to content

Commit 11eb7b6

Browse files
committed
moved Config entry from timesave to piratebox.conf
emptied out the openwrt section in timesave script, which wasn't called anymore
1 parent 8a45fae commit 11eb7b6

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

piratebox_origin/piratebox/piratebox/bin/timesave.sh

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ fi
2727

2828
. $1
2929

30-
TIMESAVE="$PIRATEBOX_FOLDER/timesave_file"
3130

3231
if [ "$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
7060
fi
7161

7262
if [ "$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
7772
fi
7873

piratebox_origin/piratebox/piratebox/conf/piratebox.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
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?
115118
DROOPY_ENABLED="yes"

0 commit comments

Comments
 (0)