We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a521c3c commit 55c4954Copy full SHA for 55c4954
bin/v-delete-sys-ip
@@ -38,10 +38,11 @@ is_ip_key_empty '$U_SYS_USERS'
38
# Import ip variables
39
source $HESTIA/data/ips/$ip
40
cidr=$(convert_netmask $NETMASK)
41
+main_ip=$(hostname -i)
42
43
# Checking main ip on the interface
44
interface=$(/sbin/ip addr | grep "$ip/$cidr" | awk '{print $NF}')
-if [ ! -z "$interface" ] && [ -z "$(echo $interface |cut -s -f2 -d :)" ]; then
45
+if [ ! -z "$interface" ] && [ "$ip" = "$main_ip" ]; then
46
echo "Error: can't delete main IP address"
47
log_event "$E_FORBIDEN" "$ARGUMENTS"
48
exit $E_FORBIDEN
0 commit comments