mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-02 10:47:19 +08:00
Compare commits
3 Commits
f13d104968
...
394131a0d7
Author | SHA1 | Date | |
---|---|---|---|
|
394131a0d7 | ||
|
4d0d16023f | ||
|
60dd794b29 |
@ -13,8 +13,8 @@ else
|
||||
fi
|
||||
|
||||
FN="boot.pat"
|
||||
DIR=$(find / -maxdepth 1 -type d -iname "$FN" | head -n 1)
|
||||
[ ! -d "$DIR" ] && DIR=$(find "$STORAGE" -maxdepth 1 -type d -iname "$FN" | head -n 1)
|
||||
DIR=$(find / -maxdepth 1 -type d -iname "$FN" -print -quit)
|
||||
[ ! -d "$DIR" ] && DIR=$(find "$STORAGE" -maxdepth 1 -type d -iname "$FN" -print -quit)
|
||||
|
||||
if [ -d "$DIR" ]; then
|
||||
BASE="DSM_VirtualDSM" && URL="file://$DIR"
|
||||
@ -23,8 +23,8 @@ if [ -d "$DIR" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
FILE=$(find / -maxdepth 1 -type f -iname "$FN" | head -n 1)
|
||||
[ ! -s "$FILE" ] && FILE=$(find "$STORAGE" -maxdepth 1 -type f -iname "$FN" | head -n 1)
|
||||
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
|
||||
|
@ -192,6 +192,7 @@ configureNAT() {
|
||||
|
||||
# Create the necessary file structure for /dev/net/tun
|
||||
if [ ! -c /dev/net/tun ]; then
|
||||
[[ "$PODMAN" == [Yy1]* ]] && return 1
|
||||
[ ! -d /dev/net ] && mkdir -m 755 /dev/net
|
||||
if mknod /dev/net/tun c 10 200; then
|
||||
chmod 666 /dev/net/tun
|
||||
@ -199,15 +200,14 @@ configureNAT() {
|
||||
fi
|
||||
|
||||
if [ ! -c /dev/net/tun ]; then
|
||||
[[ "$PODMAN" != [Yy1]* ]] && error "$tuntap"
|
||||
return 1
|
||||
error "$tuntap" && return 1
|
||||
fi
|
||||
|
||||
# Check port forwarding flag
|
||||
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
||||
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null; rc=$?; } || :
|
||||
if (( rc != 0 )) || [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
||||
[[ "$PODMAN" != [Yy1]* ]] && error "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1"
|
||||
error "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user