Commit 2c827770 authored by Yannael Girerd's avatar Yannael Girerd

Debian10 support - function vgrename modify

parent d25b3916
......@@ -3,6 +3,7 @@
progname="ug-master2instance"
current_hostname="$(cat /etc/hostname)"
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
......@@ -217,8 +218,8 @@ function change_network
pb "change_network"
pb " - write network file: ${network_path}"
construct_ug_static_ipv46 "${dev_interface}" > "${network_path}"
pb " - restart network"
if [[ "${os_id}" = "debian" ]]; then
pb " - restart network"
systemctl restart systemd-networkd | tab 3
else
systemctl restart network
......@@ -243,8 +244,15 @@ function change_vg_name
cur_uuid="$(blkid -s UUID -o value "${boot_dev}")"
pb " cur_uuid: ${cur_uuid}, new_uuid: ${new_uuid}"
pb " with cmd: tune2fs \"${boot_dev}\" -U \"${new_uuid}\""
tune2fs "${boot_dev}" -U "${new_uuid}" | tab 3
if [[ "${os_versionid}" = "10" ]]; then
umount /boot
e2fsck -f /dev/sda1
tune2fs "${boot_dev}" -U "${new_uuid}" | tab 3
mount /boot
else
tune2fs "${boot_dev}" -U "${new_uuid}" | tab 3
fi
echo ""
pb " - rename the mapper /etc/fstab"
current_mappername="$(echo ${current_hostname}| sed 's|-|--|g')"
......
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