mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-10-12 05:34:53 +08:00
revert: Simplify conditional checks (#1017)
This reverts commit 6883efb8576b0aad1fcdbc99f1d030f9ab72dd19.
This commit is contained in:
parent
6883efb857
commit
10237b31cf
18
src/disk.sh
18
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 $?
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user