File tree Expand file tree Collapse file tree 4 files changed +29
-29
lines changed
piratebox_origin/piratebox/piratebox Expand file tree Collapse file tree 4 files changed +29
-29
lines changed Original file line number Diff line number Diff line change 153153
154154set_Hostname () {
155155 local name=$1 ; shift ;
156- echo "
157- <html>
158- <head><title>Redirect...</title>
159- <meta http-equiv='refresh' content='0;url=http://$1 /' />
160- <meta http-equiv='cache-control' content='no-cache'>
161- </head>
162- <body>
163- Redirect
164- </body>
165- </html>" > $WWW_FOLDER /redirect.html
166156
157+ sed " s|#####HOST#####|$name |g" $PIRATEBOX_FOLDER /src/redirect.html.schema > $WWW_FOLDER /redirect.html
167158 sed " s|HOST=\" $HOST \" |HOST=\" $name \" |" -i $PIRATEBOX_CONFIG
168159}
169160
170161if [ $2 = " hostname" ] ; then
171162 echo " Switching hostname to $3 "
172163 set_hostname " $3 "
173164 echo " ..done"
174- fi
165+ fi
175166
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"
Original file line number Diff line number Diff line change 1+ <html>
2+ <head><title>Redirect...</title>
3+ <meta http-equiv='refresh' content='0;url=http://#####HOST#####/' />
4+ <meta http-equiv='cache-control' content='no-cache'>
5+ </head>
6+ <body>
7+ Redirect
8+ </body>
9+ </html>
10+
11+
You can’t perform that action at this time.
0 commit comments