Dateien hochladen nach „Pack/scripts“

This commit is contained in:
Stephan 2018-10-24 08:41:09 +00:00
parent 9ab31d8b91
commit 21c0661f67
4 changed files with 50 additions and 0 deletions

11
Pack/scripts/preinst Normal file
View file

@ -0,0 +1,11 @@
#!/bin/sh
machinetyp=`uname --machine`
device=`uname -a | awk -F_ '{print $NF}' | sed "s/+/plus/g" `
if [ $machinetyp = "x86_64" ] || [ $machinetyp = "i686" ] || [ `echo $machinetyp | grep "armv7" ` ] || [ `echo $machinetyp | grep "armv8" ` ]; then
exit 0
else
echo "Dein Gerät (${device}) mit der CPU-Architektur ${machinetyp} wird von synOTR nicht unterstützt (nur x86_64, i686, armv7)" > $SYNOPKG_TEMP_LOGFILE
exit 1
fi

11
Pack/scripts/preuninst Normal file
View file

@ -0,0 +1,11 @@
#!/bin/sh
if [ "$pkgwizard_remove_cronjob" != "true" ]; then
exit 0
fi
# delete Cronjob for synOTR
sed -i "/synOTR-start.sh/d" "/etc/crontab"
exit 0

20
Pack/scripts/preupgrade Normal file
View file

@ -0,0 +1,20 @@
#!/bin/sh
if [ -d "/tmp/synOTR" ]; then
rm -r /tmp/synOTR
fi
if [ -d "/usr/syno/synoman/webman/3rdparty/synOTR" ]; then
mkdir /tmp/synOTR
if [ -d "/usr/syno/synoman/webman/3rdparty/synOTR/app/etc" ]; then # Userdateien liegen erst ab V.3.9.2 im Verzeichnis /app/etc
# cp -a /usr/syno/synoman/webman/3rdparty/synOTR/app/etc/ /tmp/synOTR
cp -rf /usr/syno/synoman/webman/3rdparty/synOTR/app/etc/* /tmp/synOTR
else
cp /usr/syno/synoman/webman/3rdparty/synOTR/Konfiguration.txt /tmp/synOTR/Konfiguration.txt
cp /usr/syno/synoman/webman/3rdparty/synOTR/app/synOTR.sqlite /tmp/synOTR/synOTR.sqlite
fi
fi
exit 0

View file

@ -0,0 +1,8 @@
#!/bin/sh
LOG="/var/packages/${SYNOPKG_PKGNAME}/log"
case $1 in
start) date +'%c started' >> $LOG ;;
stop) date +'%c stopped' >> $LOG ;;
status) if tail -1 $LOG |grep started; then exit 0; else exit 1; fi ;;
log) echo "$LOG" ;;
esac