Skip to content

Commit 04c2153

Browse files
committed
Punch to alpha8
* Merge branch 'development' * repairs broken timesave functionality * copy over content instead of moving stuff around
2 parents fbd41c3 + 5bcdc77 commit 04c2153

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = librarybox
2-
VERSION = 2.0.0_alpha7
2+
VERSION = 2.0.0_alpha8
33
ARCH = all
44

55
#PIRATEBOX_IMG_URL = "http://piratebox.aod-rpg.de/piratebox_ws_0.6_img.gz"

customization/bin/hooks/hook_pre_init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ cp -rv $PIRATEBOX_FOLDER/www_old/cgi-bin $WWW_FOLDER/cgi-bin
3030
# Prepare content folder
3131
echo "Creating 'content' folder on USB stick and move over stuff"
3232
mkdir -p $WWW_CONTENT
33-
mv $PIRATEBOX_FOLDER/www_content/* $WWW_CONTENT
33+
cp -r $PIRATEBOX_FOLDER/www_content/* $WWW_CONTENT
3434
# Link to the USB-Stick
3535
ln -s $WWW_CONTENT $WWW_FOLDER/content
3636

piratebox_origin/piratebox/piratebox/bin/install_piratebox.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ if [ $2 = "flush_dns_reg" ] ; then
151151
echo "Installed crontab for flushing dnsmasq requlary"
152152
fi
153153

154-
set_Hostname() {
154+
set_hostname() {
155155
local name=$1 ; shift;
156156

157157
sed "s|#####HOST#####|$name|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/redirect.html

piratebox_origin/piratebox/piratebox/bin/timesave.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
# Licenced under GPL-2 @ 2012
1212
# Matthias Strubel matthias.strubel@aod-rgp.de
1313

14+
##function for similar saving & getting time
15+
get_datetime() {
16+
date +%C%g%m%d%H%M
17+
}
18+
1419

1520
# Load configfile
1621

@@ -34,33 +39,33 @@ if [ "$2" = "install" ] ; then
3439
echo " */5 * * * * $PIRATEBOX_FOLDER/bin/timesave.sh $PIRATEBOX_FOLDER/conf/piratebox.conf save " >> $PIRATEBOX_FOLDER/tmp/crontab
3540
crontab $PIRATEBOX_FOLDER/tmp/crontab
3641

42+
echo "initialize timesave file"
3743
touch $TIMESAVE
3844
chmod a+rw $TIMESAVE
45+
get_datetime > $TIMESAVE
3946

40-
echo "Remember to have cron active..."
41-
echo " on OpenWrt run: /etc/init.d/cron enable"
42-
echo " /etc/init.d/cron start"
4347

44-
#Save the current time
45-
$0 $1 "save"
48+
echo "Remember MAY have to cron active..."
49+
echo " on OpenWrt run: /etc/init.d/piratebox enable"
50+
4651
exit 0
4752
fi
4853

4954
if [ "$2" = "save" ] ; then
5055
if [ -e $TIMESAVE ] ; then
51-
if [ `date +%C%g%m%d%H%M` -lt `cat $TIMESAVE` ] ; then
56+
if [ `get_datetime` -lt `cat $TIMESAVE` ] ; then
5257
logger -s "$0 : sorry, current date-time is lower then saved one, don't save it this time"
5358
exit 1
5459
fi
5560
fi
5661

5762
#Save Datetime in a recoverable format...
58-
date +%C%g%m%d%H%M > $TIMESAVE
63+
get_datetime > $TIMESAVE
5964
exit 0
6065
fi
6166

6267
if [ "$2" = "recover" ] ; then
63-
if [ `date +%C%g%m%d%H%M` -lt `cat $TIMESAVE` ] ;
68+
if [ `get_datetime` -lt `cat $TIMESAVE` ] ;
6469
date `cat $TIMESAVE `
6570
[ "$?" != "0" ] && echo "error in recovering time" && exit 255
6671
echo "Time recovered"

0 commit comments

Comments
 (0)