mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-07 17:07:58 +08:00
Header
This commit is contained in:
parent
bffced2a47
commit
cdf526d455
@ -2,13 +2,13 @@
|
|||||||
set -u
|
set -u
|
||||||
|
|
||||||
VERSION="4"
|
VERSION="4"
|
||||||
HEADER="VirtualDSM Agent:"
|
HEADER="VirtualDSM Agent"
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
|
|
||||||
echo "$HEADER Shutting down.."
|
echo "$HEADER: Shutting down.."
|
||||||
exit
|
exit
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -20,7 +20,7 @@ function checkNMI {
|
|||||||
|
|
||||||
if [ "$nmi" != "" ]; then
|
if [ "$nmi" != "" ]; then
|
||||||
|
|
||||||
echo "$HEADER Received shutdown request through NMI.."
|
echo "$HEADER: Received shutdown request through NMI.."
|
||||||
|
|
||||||
/usr/syno/sbin/synoshutdown -s > /dev/null
|
/usr/syno/sbin/synoshutdown -s > /dev/null
|
||||||
finish
|
finish
|
||||||
@ -43,18 +43,18 @@ function downloadUpdate {
|
|||||||
if ! cmp --silent -- "${TMP}" "${SCRIPT}"; then
|
if ! cmp --silent -- "${TMP}" "${SCRIPT}"; then
|
||||||
mv -f "${TMP}" "${SCRIPT}"
|
mv -f "${TMP}" "${SCRIPT}"
|
||||||
chmod +x "${SCRIPT}"
|
chmod +x "${SCRIPT}"
|
||||||
echo "$HEADER succesfully installed update."
|
echo "$HEADER: succesfully installed update."
|
||||||
else
|
else
|
||||||
echo "$HEADER Update not needed."
|
echo "$HEADER: Update not needed."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "$HEADER update error, invalid header: $line"
|
echo "$HEADER: update error, invalid header: $line"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "$HEADER update error, file not found.."
|
echo "$HEADER: update error, file not found.."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "$HEADER update error, curl error: $?"
|
echo "$HEADER: update error, curl error: $?"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ function installPackages {
|
|||||||
BASE=$(basename "$filename" .spk)
|
BASE=$(basename "$filename" .spk)
|
||||||
BASE="${BASE%%-*}"
|
BASE="${BASE%%-*}"
|
||||||
|
|
||||||
echo "$HEADER Installing package ${BASE}.."
|
echo "$HEADER: Installing package ${BASE}.."
|
||||||
|
|
||||||
/usr/syno/bin/synopkg install "$filename" > /dev/null
|
/usr/syno/bin/synopkg install "$filename" > /dev/null
|
||||||
/usr/syno/bin/synopkg start "$BASE" > /dev/null &
|
/usr/syno/bin/synopkg start "$BASE" > /dev/null &
|
||||||
@ -82,7 +82,7 @@ trap finish SIGINT SIGTERM
|
|||||||
ts=$(date +%s%N)
|
ts=$(date +%s%N)
|
||||||
checkNMI
|
checkNMI
|
||||||
|
|
||||||
echo "$HEADER started v$VERSION.."
|
echo "$HEADER v$VERSION.."
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user