diff --git a/src/disk.sh b/src/disk.sh index a1cc680..7cd23df 100644 --- a/src/disk.sh +++ b/src/disk.sh @@ -596,16 +596,16 @@ DISK4_FILE="/storage4/${DISK_NAME}4" : "${DEVICE3:=""}" : "${DEVICE4:=""}" -[ -z "$DEVICE" && -b "/disk" ] && DEVICE="/disk" -[ -z "$DEVICE" && -b "/disk1" ] && DEVICE="/disk1" -[ -z "$DEVICE2" && -b "/disk2" ] && DEVICE2="/disk2" -[ -z "$DEVICE3" && -b "/disk3" ] && DEVICE3="/disk3" -[ -z "$DEVICE4" && -b "/disk4" ] && DEVICE4="/disk4" +[ -z "$DEVICE" ] && [ -b "/disk" ] && DEVICE="/disk" +[ -z "$DEVICE" ] && [ -b "/disk1" ] && DEVICE="/disk1" +[ -z "$DEVICE2" ] && [ -b "/disk2" ] && DEVICE2="/disk2" +[ -z "$DEVICE3" ] && [ -b "/disk3" ] && DEVICE3="/disk3" +[ -z "$DEVICE4" ] && [ -b "/disk4" ] && DEVICE4="/disk4" -[ -z "$DEVICE" && -b "/dev/disk1" ] && DEVICE="/dev/disk1" -[ -z "$DEVICE2" && -b "/dev/disk2" ] && DEVICE2="/dev/disk2" -[ -z "$DEVICE3" && -b "/dev/disk3" ] && DEVICE3="/dev/disk3" -[ -z "$DEVICE4" && -b "/dev/disk4" ] && DEVICE4="/dev/disk4" +[ -z "$DEVICE" ] && [ -b "/dev/disk1" ] && DEVICE="/dev/disk1" +[ -z "$DEVICE2" ] && [ -b "/dev/disk2" ] && DEVICE2="/dev/disk2" +[ -z "$DEVICE3" ] && [ -b "/dev/disk3" ] && DEVICE3="/dev/disk3" +[ -z "$DEVICE4" ] && [ -b "/dev/disk4" ] && DEVICE4="/dev/disk4" if [ -n "$DEVICE" ]; then addDevice "$DEVICE" "$DISK_TYPE" "3" "0xc" || exit $? diff --git a/src/install.sh b/src/install.sh index d32b128..e89f3c9 100644 --- a/src/install.sh +++ b/src/install.sh @@ -27,7 +27,7 @@ FILE=$(find / -maxdepth 1 -type f -iname "$FN" -print -quit) [ ! -s "$FILE" ] && FILE=$(find "$STORAGE" -maxdepth 1 -type f -iname "$FN" -print -quit) [ -s "$FILE" ] && BASE="DSM_VirtualDSM" && URL="file://$FILE" -if [ -n "$URL" && ! -s "$FILE" && ! -d "$DIR" ]; then +if [ -n "$URL" ] && [ ! -s "$FILE" ] && [ ! -d "$DIR" ]; then BASE=$(basename "$URL" .pat) if [ ! -s "$STORAGE/$BASE.system.img" ]; then BASE=$(basename "${URL%%\?*}" .pat) diff --git a/src/network.sh b/src/network.sh index abb6e21..9d7c76c 100644 --- a/src/network.sh +++ b/src/network.sh @@ -440,7 +440,7 @@ getInfo() { IP6="" # shellcheck disable=SC2143 - if [ -f /proc/net/if_inet6 && -n "$(ifconfig -a | grep inet6)" ]; then + if [ -f /proc/net/if_inet6 ] && [ -n "$(ifconfig -a | grep inet6)" ]; then IP6=$(ip -6 addr show dev "$VM_NET_DEV" scope global up) [ -n "$IP6" ] && IP6=$(echo "$IP6" | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' | head -n 1) fi diff --git a/src/reset.sh b/src/reset.sh index 8d86e93..900622f 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -200,7 +200,7 @@ html "Starting $APP for Docker..." if [[ "${WEB:-}" != [Nn]* ]]; then # shellcheck disable=SC2143 - if [ -f /proc/net/if_inet6 && -n "$(ifconfig -a | grep inet6)" ]; then + if [ -f /proc/net/if_inet6 ] && [ -n "$(ifconfig -a | grep inet6)" ]; then sed -i "s/listen 5000 default_server;/listen [::]:5000 default_server ipv6only=off;/g" /etc/nginx/sites-enabled/web.conf