mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-06 01:54:52 +08:00
Compare commits
2 Commits
f841eb1ef1
...
6883efb857
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6883efb857 | ||
|
|
1ca55cad8f |
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
|
||||
|
||||
@ -50,6 +50,11 @@ fi
|
||||
|
||||
[ -n "${CPU_CORES//[0-9 ]}" ] && error "Invalid amount of CPU_CORES: $CPU_CORES" && exit 15
|
||||
|
||||
if [ "$CPU_CORES" -gt "$CORES" ]; then
|
||||
warn "The amount for CPU_CORES (${CPU_CORES}) exceeds the amount of physical cores, so will be limited to ${CORES}."
|
||||
CPU_CORES="$CORES"
|
||||
fi
|
||||
|
||||
# Check system
|
||||
|
||||
if [ ! -d "/dev/shm" ]; then
|
||||
@ -195,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