Update linupx-scripts.sh
This commit is contained in:
@@ -699,8 +699,9 @@ RECONFIGURE_NETWORK(){
|
|||||||
read -e HOSTNAME
|
read -e HOSTNAME
|
||||||
[ "${HOSTNAME}" == "" ] && HOSTNAME=$(hostname)
|
[ "${HOSTNAME}" == "" ] && HOSTNAME=$(hostname)
|
||||||
echo
|
echo
|
||||||
echo -en "${idsCL[LightYellow]}Domain (optional): ${idsCL[Default]}"
|
echo -en "${idsCL[LightYellow]}Domain (optional) [Current='${idsCL[White]}$(hostname -d)${idsCL[LightYellow]}']: ${idsCL[Default]}"
|
||||||
read -e DOMAIN
|
read -e DOMAIN
|
||||||
|
[ "${DOMAIN}" == "" ] && DOMAIN=$(hostname -d)
|
||||||
echo
|
echo
|
||||||
REPIP=`hostname -I`
|
REPIP=`hostname -I`
|
||||||
REPIP=${REPIP/ /}
|
REPIP=${REPIP/ /}
|
||||||
@@ -748,8 +749,8 @@ RECONFIGURE_NETWORK(){
|
|||||||
*)
|
*)
|
||||||
echo -en "${idsCL[LightCyan]}Making configuration changes ... ${idsCL[Default]}"
|
echo -en "${idsCL[LightCyan]}Making configuration changes ... ${idsCL[Default]}"
|
||||||
|
|
||||||
sudo hostnamectl set-hostname ${HOSTNAME} >/dev/null 2>&1
|
hostnamectl set-hostname ${HOSTNAME} >/dev/null 2>&1
|
||||||
sudo sed -i '/127.0.1.1/d' /etc/hosts >/dev/null 2>&1
|
sed -i '/127.0.1.1/d' /etc/hosts >/dev/null 2>&1
|
||||||
[ "${DOMAIN}" == "" ] && echo "127.0.1.1 ${HOSTNAME}" >> /etc/hosts || echo "127.0.1.1 ${HOSTNAME}.${DOMAIN} ${HOSTNAME}" >> /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}`
|
NEWSUB=`IPprefix_by_netmask ${SUBNET}`
|
||||||
@@ -763,14 +764,17 @@ RECONFIGURE_NETWORK(){
|
|||||||
|
|
||||||
sed -i "s/${REPGW}/${GATEWAY}/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
|
sed -i '/search/d' /etc/netplan/eth0.yaml >/dev/null 2>&1
|
||||||
|
if [ "${DOMAIN}" != "" ]; then
|
||||||
|
echo " search: [${DOMAIN}]" >> /etc/netplan/eth0.yaml
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo -e "\n${idsCL[Green]}Network has been updated${idsCL[Default]}]\n"
|
echo -e "\n${idsCL[Green]}Network has been updated${idsCL[Default]}\n"
|
||||||
read -n 1 -s -p "Press any key to continue"
|
read -n 1 -s -p "Press any key to continue"
|
||||||
echo
|
echo
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user