neutrino: adapt backup/restore scripts to ensure compatibility with ni-ofgwrite

This commit is contained in:
J. Krieg
2018-11-01 17:26:15 +01:00
committed by Thilo Graf
parent 396d7bb42a
commit d23bf1106e
2 changed files with 10 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
DATE=$(date +%Y-%m-%d_%H-%M-%S) DATE=$(date +%Y-%m-%d_%H-%M-%S)
USRF="/var/tuxbox/config/tobackup.conf" USRF="/var/tuxbox/config/tobackup.conf"
BAKF="$1/${2:-settings_${DATE}.tar.gz}"
if [ -e "${USRF}" ]; then if [ -e "${USRF}" ]; then
# read user-files from $USRF # read user-files from $USRF
@@ -22,6 +23,6 @@ for i in $TOBACKUP
TOBACKUP=$(echo $RES) TOBACKUP=$(echo $RES)
echo Backup to $1/settings_$DATE.tar echo Backup to $BAKF
tar -cf $1/settings_$DATE.tar $TOBACKUP 2>&1 >/dev/null tar -czf $BAKF $TOBACKUP 2>&1 >/dev/null

View File

@@ -8,7 +8,13 @@ else
cd / cd /
fi fi
tar xf $1 # check if $1 ends with "gz"
if [ "$1" != "${1%gz}" ]; then
tar -xzf $1
else
tar -xf $1
fi
sync sync
sync sync
reboot -f reboot -f