Update linupx-scripts.sh
This commit is contained in:
@@ -699,6 +699,9 @@ RECONFIGURE_NETWORK(){
|
||||
read -e HOSTNAME
|
||||
[ "${HOSTNAME}" == "" ] && HOSTNAME=$(hostname)
|
||||
echo
|
||||
echo -en "${idsCL[LightYellow]}Domain (optional): ${idsCL[Default]}"
|
||||
read -e DOMAIN
|
||||
echo
|
||||
REPIP=`hostname -I`
|
||||
REPIP=${REPIP/ /}
|
||||
echo -en "${idsCL[LightYellow]}IP Address [Current='${idsCL[White]}${REPIP}${idsCL[LightYellow]}']: ${idsCL[Default]}"
|
||||
@@ -728,6 +731,10 @@ RECONFIGURE_NETWORK(){
|
||||
echo
|
||||
echo "Confirm settings:"
|
||||
echo -e "${idsCL[LightCyan]}Hostname : ${idsCL[Green]}${HOSTNAME}${idsCL[Default]}"
|
||||
if [ "${DOMAIN}" != "" ]; then
|
||||
echo -e "${idsCL[LightCyan]}Domain : ${idsCL[Green]}${DOMAIN}${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightCyan]}FQDN : ${idsCL[Green]}${HOSTNAME}.${DOMAIN}${idsCL[Default]}"
|
||||
fi
|
||||
echo -e "${idsCL[LightCyan]}IP Address : ${idsCL[Green]}${IPADDRESS}${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightCyan]}Subnet Mask : ${idsCL[Green]}${SUBNET}${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightCyan]}Gateway IP : ${idsCL[Green]}${GATEWAY}${idsCL[Default]}"
|
||||
@@ -743,7 +750,7 @@ RECONFIGURE_NETWORK(){
|
||||
|
||||
sudo hostnamectl set-hostname ${HOSTNAME} >/dev/null 2>&1
|
||||
sudo sed -i '/127.0.1.1/d' /etc/hosts >/dev/null 2>&1
|
||||
echo "127.0.1.1 ${HOSTNAME} mm" >> /etc/hosts
|
||||
[ "${DOMAIN}" == "" ] && echo "127.0.1.1 ${HOSTNAME}" >> /etc/hosts || echo "127.0.1.1 ${HOSTNAME}.${DOMAIN} ${HOSTNAME}" >> /etc/hosts
|
||||
|
||||
NEWSUB=`IPprefix_by_netmask ${SUBNET}`
|
||||
REPSUB=`IPprefix_by_netmask ${REPSUB}`
|
||||
@@ -755,6 +762,8 @@ RECONFIGURE_NETWORK(){
|
||||
sed -i "s/${REPDNS}/${DNS}/g" /etc/netplan/eth0.yaml >/dev/null 2>&1
|
||||
|
||||
sed -i "s/${REPGW}/${GATEWAY}/g" /etc/netplan/eth0.yaml >/dev/null 2>&1
|
||||
|
||||
[ "${DOMAIN}" != "" ] && echo " search: [${DOMAIN}]" >> /etc/netplan/eth0.yaml
|
||||
|
||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user