mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
NI \o/
Origin commit data
------------------
Branch: ni/coolstream
Commit: d6b3754c6f
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-05-19 (Thu, 19 May 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -3,9 +3,21 @@ installdir = $(bindir)
|
||||
install_DATA = \
|
||||
backup.sh \
|
||||
restore.sh \
|
||||
wakeup.sh \
|
||||
install.sh
|
||||
|
||||
if BOXMODEL_APOLLO
|
||||
install_DATA += \
|
||||
backup_flash.sh \
|
||||
restore_flash.sh
|
||||
endif
|
||||
|
||||
install-data-hook:
|
||||
chmod 0755 $(DESTDIR)$(bindir)/backup.sh
|
||||
chmod 0755 $(DESTDIR)$(bindir)/restore.sh
|
||||
chmod 0755 $(DESTDIR)$(bindir)/wakeup.sh
|
||||
chmod 0755 $(DESTDIR)$(bindir)/install.sh
|
||||
if BOXMODEL_APOLLO
|
||||
chmod 0755 $(DESTDIR)$(bindir)/backup_flash.sh
|
||||
chmod 0755 $(DESTDIR)$(bindir)/restore_flash.sh
|
||||
endif
|
||||
|
@@ -1,17 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
DATE=$(date +%Y-%m-%d_%H-%M-%S)
|
||||
. /etc/init.d/globals
|
||||
|
||||
DATE=$(hostname)_$(date +%Y-%m-%d_%H-%M-%S)
|
||||
USRF="/var/tuxbox/config/tobackup.conf"
|
||||
BAKF="$1/settings_$DATE.tar.gz"
|
||||
|
||||
TOBACKUP="\
|
||||
/share/tuxbox/neutrino/flex/flex_eigene_scripte.conf \
|
||||
/var/tuxbox/config/FritzCallMonitor.addr \
|
||||
/var/tuxbox/config/FritzCallMonitor.cfg \
|
||||
/var/tuxbox/config/radio-favorites.xml \
|
||||
/var/tuxbox/config/timerd.conf \
|
||||
/var/tuxbox/config/tuxcal/ \
|
||||
/var/tuxbox/config/tuxmail/ \
|
||||
/var/tuxbox/config/zapit/ \
|
||||
/var/tuxbox/config/doscam.* \
|
||||
/var/tuxbox/config/neutrino.conf \
|
||||
/var/tuxbox/config/oscam.* \
|
||||
/var/tuxbox/config/oscammon.conf \
|
||||
/var/tuxbox/config/scan.conf \
|
||||
/var/bin/ \
|
||||
/var/etc/ \
|
||||
/var/keys/ \
|
||||
/etc/auto.net \
|
||||
/etc/exports \
|
||||
/etc/fstab \
|
||||
/etc/hostname \
|
||||
/etc/resolv.conf \
|
||||
/etc/profile.local \
|
||||
/etc/network/interfaces \
|
||||
/etc/wpa_supplicant.conf \
|
||||
/etc/passwd \
|
||||
"
|
||||
|
||||
SHOWINFO "backup to ${BAKF} ..."
|
||||
|
||||
if [ -e "${USRF}" ]; then
|
||||
# read user-files from $USRF
|
||||
TOBACKUP="${USRF}"
|
||||
TOBACKUP="$TOBACKUP ${USRF}"
|
||||
while read i
|
||||
do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}"
|
||||
done < $USRF
|
||||
|
||||
else
|
||||
TOBACKUP="/var/tuxbox/config/"
|
||||
fi
|
||||
|
||||
# check existence
|
||||
@@ -22,6 +51,6 @@ for i in $TOBACKUP
|
||||
|
||||
TOBACKUP=$(echo $RES)
|
||||
|
||||
echo Backup to $1/settings_$DATE.tar
|
||||
tar -czf "${BAKF}" $TOBACKUP 2>&1 >/dev/null
|
||||
|
||||
tar -cf $1/settings_$DATE.tar $TOBACKUP 2>&1 >/dev/null
|
||||
SHOWINFO "done."
|
||||
|
35
data/scripts/backup_flash.sh
Normal file
35
data/scripts/backup_flash.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/init.d/globals
|
||||
|
||||
RES=""
|
||||
VAR="/var/"
|
||||
USRF="/var/tuxbox/config/tobackup.conf"
|
||||
BAKF="/var/backup_flash.tar.gz"
|
||||
|
||||
TOBACKUP="/etc/auto.net*"
|
||||
|
||||
SHOWINFO "backup to ${BAKF} ..."
|
||||
|
||||
if [ -e "${USRF}" ]; then
|
||||
TOBACKUP="$TOBACKUP ${USRF}"
|
||||
while read i
|
||||
do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}"
|
||||
done < $USRF
|
||||
fi
|
||||
|
||||
# check existence and skip files in /var
|
||||
for i in $TOBACKUP; do
|
||||
if [ -e "$i" -a ${i:0:${#VAR}} != ${VAR} ]; then
|
||||
SHOWINFO "add $i"
|
||||
RES="$RES $i"
|
||||
else
|
||||
SHOWINFO "skip $i"
|
||||
fi
|
||||
done
|
||||
|
||||
TOBACKUP=$(echo $RES)
|
||||
|
||||
tar -czf "${BAKF}" $TOBACKUP 2>&1 >/dev/null
|
||||
|
||||
SHOWINFO "done."
|
@@ -1,14 +1,19 @@
|
||||
#!/bin/sh
|
||||
echo Restore settings from $1
|
||||
|
||||
tar t -f $1 | grep ^config/ > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
cd /var/tuxbox
|
||||
else
|
||||
cd /
|
||||
fi
|
||||
. /etc/init.d/globals
|
||||
|
||||
BAKF="$1"
|
||||
E=0
|
||||
|
||||
tar xf $1
|
||||
sync
|
||||
sleep 2
|
||||
killall start_neutrino; E=$(($E+$?))
|
||||
killall neutrino; E=$(($E+$?))
|
||||
sleep 3
|
||||
|
||||
SHOWINFO "restore settings from "${BAKF}""
|
||||
cd / && tar -xzf "${BAKF}"
|
||||
sync
|
||||
reboot -f
|
||||
SHOWINFO "done."
|
||||
|
||||
test $E -eq 0 && reboot || reboot -f
|
||||
|
15
data/scripts/restore_flash.sh
Normal file
15
data/scripts/restore_flash.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/init.d/globals
|
||||
|
||||
BAKF="/var/backup_flash.tar.gz"
|
||||
|
||||
if [ -e ${BAKF} ]; then
|
||||
SHOWINFO "restore settings from ${BAKF} ..."
|
||||
cd / && tar -xzf "${BAKF}"
|
||||
sync
|
||||
rm -rf "${BAKF}"
|
||||
SHOWINFO "done."
|
||||
else
|
||||
SHOWINFO "${BAKF} not found. nothing to restore!"
|
||||
fi
|
12
data/scripts/wakeup.sh
Normal file
12
data/scripts/wakeup.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/init.d/globals
|
||||
|
||||
test $1 || { SHOWINFO "error"; exit 1; }
|
||||
|
||||
directory="$(echo ${@%/})"
|
||||
timestamp="$(date +%Y%m%d%H%M%S)"
|
||||
flag="${directory}/.wakeUp_${timestamp}"
|
||||
|
||||
SHOWINFO "try to wake up \"${directory}\" ..."
|
||||
touch "${flag}" 2>/dev/null && rm -f "${flag}"
|
Reference in New Issue
Block a user