-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Pre- and Post-Installation routines
- Loading branch information
1 parent
821c8ce
commit f607b1a
Showing
3 changed files
with
32 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# To use important variables from command line use the following code: | ||
ARGV0=$0 # Zero argument is shell command | ||
# echo "<INFO> Command is: $ARGV0" | ||
|
||
ARGV1=$1 # First argument is temp folder during install | ||
# echo "<INFO> Temporary folder is: $ARGV1" | ||
|
||
ARGV2=$2 # Second argument is Plugin-Name for scipts etc. | ||
# echo "<INFO> (Short) Name is: $ARGV2" | ||
|
||
ARGV3=$3 # Third argument is Plugin installation folder | ||
# echo "<INFO> Installation folder is: $ARGV3" | ||
|
||
ARGV4=$4 # Forth argument is Plugin version | ||
# echo "<INFO> Installation folder is: $ARGV4" | ||
|
||
ARGV5=$5 # Fifth argument is Base folder of LoxBerry | ||
# echo "<INFO> Base folder is: $ARGV5" | ||
|
||
ARGV6=$6 # Full path to temporary installation folder | ||
COMMAND=$0 # Zero argument is shell command | ||
PTEMPDIR=$1 # First argument is temp folder during install | ||
PSHNAME=$2 # Second argument is Plugin-Name for scipts etc. | ||
PDIR=$3 # Third argument is Plugin installation folder | ||
PVERSION=$4 # Forth argument is Plugin version | ||
#LBHOMEDIR=$5 # Comes from /etc/environment now. Fifth argument is | ||
# Base folder of LoxBerry | ||
PTEMPPATH=$6 # Sixth argument is full temp path during install (see also $1) | ||
|
||
# Combine them with /etc/environment | ||
PCGI=$LBPCGI/$PDIR | ||
PHTML=$LBPHTML/$PDIR | ||
PTEMPL=$LBPTEMPL/$PDIR | ||
PDATA=$LBPDATA/$PDIR | ||
PLOG=$LBPLOG/$PDIR # Note! This is stored on a Ramdisk now! | ||
PCONFIG=$LBPCONFIG/$PDIR | ||
PSBIN=$LBPSBIN/$PDIR | ||
PBIN=$LBPBIN/$PDIR | ||
|
||
echo "<INFO> Stopping MQTT Gateway service" | ||
pkill mqttgateway.pl | ||
|
||
echo "<INFO> Creating temporary folders for upgrading" | ||
mkdir /tmp/$ARGV1\_upgrade | ||
mkdir /tmp/$ARGV1\_upgrade/config | ||
# mkdir /tmp/$ARGV1\_upgrade/log | ||
mkdir /tmp/$PTEMPDIR\_upgrade | ||
mkdir /tmp/$PTEMPDIR\_upgrade/config | ||
|
||
echo "<INFO> Backing up existing config files" | ||
cp -v -r $ARGV5/config/plugins/$ARGV3/ /tmp/$ARGV1\_upgrade/config | ||
|
||
# echo "<INFO> Backing up existing log files" | ||
# cp -v -r $ARGV5/log/plugins/$ARGV3/ /tmp/$ARGV1\_upgrade/log | ||
cp -v -r $PCONFIG/ /tmp/$PTEMPDIR\_upgrade/config | ||
|
||
# Exit with Status 0 | ||
exit 0 |