-
Notifications
You must be signed in to change notification settings - Fork 9
/
postupgrade.sh
36 lines (27 loc) · 1.21 KB
/
postupgrade.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
ARGV0=$0 # Zero argument is shell command
ARGV1=$1 # First argument is temp folder during install
ARGV2=$2 # Second argument is Plugin-Name for scipts etc.
ARGV3=$3 # Third argument is Plugin installation folder
ARGV4=$4 # Forth argument is Plugin version
ARGV5=$5 # Fifth argument is Base folder of LoxBerry
echo "<INFO> Copy back existing config files"
cp -p -v -r /tmp/$ARGV1\_upgrade/config/$ARGV3/* $ARGV5/config/plugins/$ARGV3/
echo "<INFO> Copy back existing log files"
cp -p -v -r /tmp/$ARGV1\_upgrade/log/$ARGV3/* $ARGV5/log/plugins/$ARGV3/
echo "<INFO> Copy back custom theme files"
cp -p -v -r /tmp/$ARGV1\_upgrade/themes/* $ARGV5/templates/plugins/$ARGV3/themes
echo "<INFO> Remove temporary folders"
rm -r /tmp/$ARGV1\_upgrade
echo "<INFO> Recreate cronjob for fetching data from Weather Services"
rm $ARGV5/system/cron/cron.01min/$ARGV3
ln -s $ARGV5/bin/plugins/$ARGV3/cronjob.pl $ARGV5/system/cron/cron.01min/$ARGV3
# Read config
. $LBHOMEDIR/libs/bashlib/iniparser.sh
iniparser $ARGV5/config/plugins/$ARGV3/weather4lox.cfg "SERVER"
if [ $SERVEREMU -eq 1 ]; then
echo "<INFO> Enabling Cloud Weather Emulator"
$ARGV5/bin/plugins/$ARGV3/cloudemu enable > /dev/null 2>&1
fi
# Exit with Status 0
exit 0