mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-09-18 23:14:48 +08:00
Compare commits
3 Commits
238ebd273b
...
57a902ad9f
Author | SHA1 | Date | |
---|---|---|---|
|
57a902ad9f | ||
|
a7e229aaae | ||
|
10466d7851 |
@ -152,7 +152,18 @@ getUserPorts() {
|
||||
list="${list%% }"
|
||||
|
||||
for port in $list; do
|
||||
args+="hostfwd=tcp::$port-$VM_NET_IP:$port,"
|
||||
proto="tcp"
|
||||
num="$port"
|
||||
|
||||
if [[ "$port" == */udp ]]; then
|
||||
proto="udp"
|
||||
num="${port%/udp}"
|
||||
elif [[ "$port" == */tcp ]]; then
|
||||
proto="tcp"
|
||||
num="${port%/tcp}"
|
||||
fi
|
||||
|
||||
args+="hostfwd=$proto::$num-$VM_NET_IP:$num,"
|
||||
done
|
||||
|
||||
echo "${args%?}"
|
||||
|
24
src/proc.sh
24
src/proc.sh
@ -128,6 +128,30 @@ else
|
||||
|
||||
fi
|
||||
|
||||
if [[ "$ARGUMENTS" == *"-cpu host,"* ]]; then
|
||||
|
||||
args="${ARGUMENTS} "
|
||||
prefix="${args/-cpu host,*/}"
|
||||
suffix="${args/*-cpu host,/}"
|
||||
param="${suffix%% *}"
|
||||
suffix="${suffix#* }"
|
||||
args="${prefix}${suffix}"
|
||||
ARGUMENTS="${args::-1}"
|
||||
|
||||
if [ -z "$CPU_FLAGS" ]; then
|
||||
CPU_FLAGS="$param"
|
||||
else
|
||||
CPU_FLAGS+=",$param"
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
if [[ "$ARGUMENTS" == *"-cpu host"* ]]; then
|
||||
ARGUMENTS="${ARGUMENTS//-cpu host/}"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ -z "$CPU_FLAGS" ]; then
|
||||
if [ -z "$CPU_FEATURES" ]; then
|
||||
CPU_FLAGS="$CPU_MODEL"
|
||||
|
@ -160,6 +160,7 @@ setCountry() {
|
||||
[ -z "$COUNTRY" ] && getCountry "https://ifconfig.co/json" ".country_iso"
|
||||
[ -z "$COUNTRY" ] && getCountry "https://api.ip2location.io" ".country_code"
|
||||
[ -z "$COUNTRY" ] && getCountry "https://ipinfo.io/json" ".country"
|
||||
[ -z "$COUNTRY" ] && getCountry "https://api.ipquery.io/?format=json" ".location.country_code"
|
||||
[ -z "$COUNTRY" ] && getCountry "https://api.myip.com" ".cc"
|
||||
|
||||
return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user