Update linupx-scripts.sh
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
action="$1"
|
||||
FOLDER='/opt/idssys/linupx'
|
||||
VERS='6.2-07172023'
|
||||
VERS='6.5-07252023'
|
||||
|
||||
if [ -d /opt/idssys/settings ]; then
|
||||
[ $(ls /opt/idssys/settings | wc -l) -eq 0 ] && rm -rf /opt/idssys/settings
|
||||
@@ -690,6 +690,28 @@ UPDATEREPOKEYS(){
|
||||
}
|
||||
|
||||
RECONFIGURE_NETWORK(){
|
||||
|
||||
if [ -f /etc/netplan/99-netcfg-* ]; then
|
||||
echo -en "${idsCL[LightYellow]}New VM Detected, fixing netplan: "
|
||||
rm -f /etc/netplan/*.yaml >/dev/null 2>&1
|
||||
[ -f /etc/netplan/eth0* ] && mv /etc/netplan/eth0* /etc/netplan/eth0.yaml >/dev/null 2>&1
|
||||
if [ ! -f /etc/netplan/eth0.yaml ]; then
|
||||
echo -e "network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses: [10.10.4.20/16]
|
||||
gateway4: 10.10.0.1
|
||||
nameservers:
|
||||
addresses: [10.10.10.10,10.10.10.11]
|
||||
" > /etc/netplan/eth0.yaml >/dev/null 2>&1
|
||||
fi
|
||||
netplan apply >/dev/null 2>&1
|
||||
echo "${idsCL[Green]}Done${idsCL[Default]}\n\n"
|
||||
fi
|
||||
|
||||
echo -en "\n${idsCL[LightCyan]}Would you like to configure the hostname and network settings (y/N)? ${idsCL[Default]}"
|
||||
read choice
|
||||
case "$choice" in
|
||||
@@ -748,23 +770,7 @@ RECONFIGURE_NETWORK(){
|
||||
*)
|
||||
echo -en "${idsCL[LightCyan]}Making configuration changes ... ${idsCL[Default]}"
|
||||
|
||||
if [ -f /etc/netplan/99-netcfg-* ]; then
|
||||
rm -f /etc/netplan/*.yaml >/dev/null 2>&1
|
||||
[ -f /etc/netplan/eth0* ] && mv /etc/netplan/eth0* /etc/netplan/eth0.yaml
|
||||
if [ ! -f /etc/netplan/eth0.yaml ]; then
|
||||
echo -e "network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: no
|
||||
addresses: [10.5.4.20/20]
|
||||
gateway4: 10.5.1.1
|
||||
nameservers:
|
||||
addresses: [10.10.10.10,10.10.10.11]
|
||||
" > /etc/netplan/eth0.yaml
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
hostnamectl set-hostname ${HOSTNAME} >/dev/null 2>&1
|
||||
sed -i '/127.0.1.1/d' /etc/hosts >/dev/null 2>&1
|
||||
|
||||
Reference in New Issue
Block a user