Commit 76ba3a10 authored by Yannael Girerd's avatar Yannael Girerd

Bug fix + shutdown auto 1min

parent 2c827770
......@@ -2,8 +2,8 @@
progname="ug-master2instance"
current_hostname="$(cat /etc/hostname)"
os_id=$(. /etc/os-release; echo $ID)
os_versionid=$(. /etc/os-release; echo $VERSION_ID)
os_id=$(. /etc/os-release; echo ${ID})
os_versionid=$(. /etc/os-release; echo ${VERSION_ID})
if [[ "${os_id}" = "rhel" || "${os_id}" = "centos" ]]; then
ssh_service_name="sshd"
else
......@@ -246,7 +246,7 @@ function change_vg_name
pb " with cmd: tune2fs \"${boot_dev}\" -U \"${new_uuid}\""
if [[ "${os_versionid}" = "10" ]]; then
umount /boot
e2fsck -f /dev/sda1
e2fsck -fy /dev/sda1
tune2fs "${boot_dev}" -U "${new_uuid}" | tab 3
mount /boot
else
......@@ -320,6 +320,11 @@ function clean_up
pb " - at in 5min: userdel -rf vmgars"
at now + 5 minutes <<EOF
userdel -rf vmgars >/dev/null 2>&1
EOF
elif [[ "${os_id}" = "debian" && "${os_versionid}" = "10" ]]; then
pb " - at in 5min: userdel -rf vmgars"
at now + 5 minutes <<EOF
userdel -rf vmgars >/dev/null 2>&1
EOF
else
pb " - userdel -rf vmgars"
......@@ -349,6 +354,8 @@ ipv6_address_n_lenmask="$7"
ipv6_gateway="$8"
lip_dns="$9"
pb "${new_hostname}, ${os_id} ${os_versionid}"
test_prerequesite
echo ""
change_hostname
......@@ -360,3 +367,6 @@ echo ""
expand_disk
echo ""
clean_up
echo ""
echo "Reboot in one minute"
shutdown -r +1
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment