mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
- data/scripts: remove some hardcoded paths
Conflicts: data/config/settingsupdate.conf.in data/scripts/backup.sh data/scripts/backup_flash.sh.in data/scripts/restore_flash.sh.in Signed-off-by: Thilo Graf <dbt@novatux.de> Files adapted because conflicts and possible build errors.
This commit is contained in:
31
data/scripts/backup.sh.in
Normal file
31
data/scripts/backup.sh.in
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
|
||||
HOST=$(hostname)
|
||||
DATE=$(date +%Y%m%d_%H%M)
|
||||
USRF="@CONFIGDIR@/tobackup.conf"
|
||||
BAKF="$1/${2:-settings_${HOST}_${DATE}}.tar.gz"
|
||||
|
||||
if [ -e "${USRF}" ]; then
|
||||
# read user-files from $USRF
|
||||
TOBACKUP="${USRF}"
|
||||
while read i
|
||||
do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}"
|
||||
done < $USRF
|
||||
|
||||
else
|
||||
TOBACKUP="@CONFIGDIR@/"
|
||||
fi
|
||||
|
||||
# check existence
|
||||
RES=""
|
||||
for i in $TOBACKUP
|
||||
do [ -e "$i" ] && RES="$RES $i"
|
||||
done
|
||||
|
||||
TOBACKUP=$(echo $RES)
|
||||
|
||||
echo Backup to $BAKF
|
||||
|
||||
tar -czf $BAKF $TOBACKUP 2>&1 >/dev/null
|
Reference in New Issue
Block a user