Skip to content

Commit

Permalink
feat: Implement correct update feature to enable auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Schwab committed Jan 23, 2022
1 parent ba30e23 commit b35943a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
14 changes: 7 additions & 7 deletions postupgrade.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# Bash script which is executed in case of an update (if this plugin is already
# installed on the system). This script is executed as very last step (*AFTER*
Expand Down Expand Up @@ -61,15 +61,15 @@ PBIN=$LBPBIN/$PDIR
#echo "<INFO> Plugin CONFIG folder is: $PCONFIG"

echo "<INFO> Copy back existing config files"
cp -v -r /tmp/$ARGV1/_upgrade/config/$ARGV3/* $ARGV5/config/plugins/$ARGV3/
cp -v /tmp/$PTEMPDIR/_upgrade/config/p1decrypter.cfg $PCONFIG/p1decrypter.cfg

# echo "<INFO> Adding new config parameters"
# grep -q -F "VERBOSE=" $ARGV5/config/plugins/$ARGV3/p1decrypter.cfg || echo "VERBOSE=0" >> $ARGV5/config/plugins/$ARGV3/p1decrypter.cfg

echo "<INFO> Copy back existing log files"
cp -v -r /tmp/$ARGV1/_upgrade/log/$ARGV3/* $ARGV5/log/plugins/$ARGV3/
# grep -q -F "VERBOSE=" $PCONFIG/p1decrypter.cfg || echo "VERBOSE=0" >> $PCONFIG/p1decrypter.cfg

echo "<INFO> Remove temporary folders"
rm -rf /tmp/$ARGV1/_upgrade
rm -rf /tmp/$PTEMPDIR/_upgrade

echo "<INFO> Start P1 Decrypter"
/bin/bash $PDIR/system/cron/cron.05min/p1decrypter > /dev/null 2>&1 &

exit 0
5 changes: 2 additions & 3 deletions prerelease.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
# the donwload link here


# Version of the new release
VERSION=1.0.0
VERSION=1.1.0

# Download URL of the ZIP Archive
ARCHIVEURL=https://github.com/metrophos/LoxBerry-Plugin-P1-Decrypter/archive/1.0.0.zip
ARCHIVEURL=https://github.com/metrophos/LoxBerry-Plugin-P1-Decrypter/archive/1.1.0.zip

# URL for further information about this release
INFOURL=https://github.com/metrophos/LoxBerry-Plugin-P1-Decrypter/releases
11 changes: 5 additions & 6 deletions preupgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ PBIN=$LBPBIN/$PDIR
#echo "<INFO> Plugin Log folder (on RAMDISK!) is: $PLOG"
#echo "<INFO> Plugin CONFIG folder is: $PCONFIG"

echo "<INFO> Stop P1 Decrypter"
pkill -9 -f p1decrypter.py

echo "<INFO> Creating temporary folders for upgrading"
mkdir -p /tmp/$ARGV1/_upgrade/config
mkdir -p /tmp/$ARGV1/_upgrade/log
mkdir -p /tmp/$PTEMPDIR/_upgrade/config

echo "<INFO> Backup existing config files"
cp -v -r $ARGV5/config/plugins/$ARGV3/ /tmp/$ARGV1/_upgrade/config

echo "<INFO> Backup existing log files"
cp -v -r $ARGV5/log/plugins/$ARGV3/ /tmp/$ARGV1/_upgrade/log
cp -v $PCONFIG/p1decrypter.cfg /tmp/$PTEMPDIR/_upgrade/config/p1decrypter.cfg

exit 0

0 comments on commit b35943a

Please sign in to comment.