Error messages

Error messages
This commit is contained in:
Kroese 2023-04-27 23:05:17 +02:00 committed by GitHub
commit a457d55a9b
3 changed files with 15 additions and 13 deletions

View File

@ -34,12 +34,12 @@ rm -rf "$TMP" && mkdir -p "$TMP"
LOC="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat" LOC="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
{ curl -r 64493568-69886247 -sfk -o "$RD" "$LOC"; rc=$?; } || : { curl -r 64493568-69886247 -sfk -o "$RD" "$LOC"; rc=$?; } || :
(( rc != 0 )) && echo "Failed to download extractor, reason: $rc" && exit 60 (( rc != 0 )) && echo "ERROR: Failed to download extractor, reason: $rc" && exit 60
SUM=$(md5sum "$RD" | cut -f 1 -d " ") SUM=$(md5sum "$RD" | cut -f 1 -d " ")
if [ "$SUM" != "14fb88cb7cabddb5af1d0269bf032845" ]; then if [ "$SUM" != "14fb88cb7cabddb5af1d0269bf032845" ]; then
echo "Invalid extractor, checksum mismatch." && exit 61 echo "ERROR: Invalid extractor, checksum mismatch." && exit 61
fi fi
set +e set +e
@ -69,14 +69,16 @@ else
PROGRESS="--progress=dot:giga" PROGRESS="--progress=dot:giga"
fi fi
wget "$URL" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS" if ! wget "$URL" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS"; then
echo "ERROR: Failed to download $URL" && exit 69
fi
[ ! -f "$PAT" ] && echo "Download failed" && exit 61 [ ! -f "$PAT" ] && echo "ERROR: Failed to download $URL" && exit 69
SIZE=$(stat -c%s "$PAT") SIZE=$(stat -c%s "$PAT")
if ((SIZE<250000000)); then if ((SIZE<250000000)); then
echo "Invalid PAT file: File is an update pack which contains no OS image." && exit 62 echo "ERROR: Invalid PAT file: File is an update pack which contains no OS image." && exit 62
fi fi
echo "Install: Extracting downloaded image..." echo "Install: Extracting downloaded image..."
@ -86,7 +88,7 @@ if { tar tf "$PAT"; } >/dev/null 2>&1; then
else else
export LD_LIBRARY_PATH="/run/extract" export LD_LIBRARY_PATH="/run/extract"
if ! /run/extract/syno_extract_system_patch "$PAT" "$TMP/." ; then if ! /run/extract/syno_extract_system_patch "$PAT" "$TMP/." ; then
echo "Invalid PAT file: File is an update pack which contains no OS image." && exit 63 echo "ERROR: Invalid PAT file: File is an update pack which contains no OS image." && exit 63
fi fi
export LD_LIBRARY_PATH="" export LD_LIBRARY_PATH=""
fi fi
@ -96,14 +98,14 @@ IDB="$TMP/indexdb"
PKG="$TMP/packages" PKG="$TMP/packages"
HDP="$TMP/synohdpack_img" HDP="$TMP/synohdpack_img"
[ ! -f "$HDA.tgz" ] && echo "Invalid PAT file: contains no OS image." && exit 64 [ ! -f "$HDA.tgz" ] && echo "ERROR: Invalid PAT file: contains no OS image." && exit 64
[ ! -f "$HDP.txz" ] && echo "Invalid PAT file: contains no HD pack." && exit 65 [ ! -f "$HDP.txz" ] && echo "ERROR: Invalid PAT file: contains no HD pack." && exit 65
[ ! -f "$IDB.txz" ] && echo "Invalid PAT file: contains no IndexDB." && exit 66 [ ! -f "$IDB.txz" ] && echo "ERROR: Invalid PAT file: contains no IndexDB." && exit 66
[ ! -d "$PKG" ] && echo "Invalid PAT file: contains no packages." && exit 68 [ ! -d "$PKG" ] && echo "ERROR: Invalid PAT file: contains no packages." && exit 68
BOOT=$(find "$TMP" -name "*.bin.zip") BOOT=$(find "$TMP" -name "*.bin.zip")
[ ! -f "$BOOT" ] && echo "Invalid PAT file: contains no boot file." && exit 67 [ ! -f "$BOOT" ] && echo "ERROR: Invalid PAT file: contains no boot file." && exit 67
BOOT=$(echo "$BOOT" | head -c -5) BOOT=$(echo "$BOOT" | head -c -5)
unzip -q -o "$BOOT".zip -d "$TMP" unzip -q -o "$BOOT".zip -d "$TMP"

View File

@ -189,7 +189,7 @@ if [ ! -c /dev/net/tun ]; then
chmod 666 /dev/net/tun chmod 666 /dev/net/tun
fi fi
[ ! -c /dev/net/tun ] && echo "Error: TUN network interface not available..." && exit 85 [ ! -c /dev/net/tun ] && echo "ERROR: TUN network interface not available..." && exit 85
update-alternatives --set iptables /usr/sbin/iptables-legacy > /dev/null update-alternatives --set iptables /usr/sbin/iptables-legacy > /dev/null
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy > /dev/null update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy > /dev/null

View File

@ -39,7 +39,7 @@ _graceful_shutdown() {
if [[ ! "${RESPONSE}" =~ "\"success\"" ]] ; then if [[ ! "${RESPONSE}" =~ "\"success\"" ]] ; then
echo echo
echo "Could not send shutdown command to guest, error: $RESPONSE" echo "ERROR: Could not send shutdown command to the guest ($RESPONSE)"
# If we cannot shutdown the usual way, fallback to the NMI method # If we cannot shutdown the usual way, fallback to the NMI method