-
Notifications
You must be signed in to change notification settings - Fork 1
/
vg_name_change
33 lines (26 loc) · 921 Bytes
/
vg_name_change
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#created by Georgi Dimitrov
echo "$1 is a old vg name"
echo "$2 is a new vg name"
vgrename $1 $2
cp /etc/fstab /etc/fstab.back
sed -i "s/$1/$2/" /etc/fstab
if [ -f /boot/grub/menu.lst ]
then
cp /boot/grub/menu.lst /boot/grub/menu.back
sed -i "s/$1/$2/" /boot/grub/menu.lst
elif [ -f /boot/grub2/grub.cfg ]
then
cp /boot/grub2/grub.cfg /boot/grub2/grub.back
sed -i "s/$1/$2/" /boot/grub2/grub.cfg
sed -i "s/$1/$2/" /etc/default/grub
dracut -f && grub2-mkconfig
fi
##unregister server from APX#####
/opt/apxpccp/pccprel exec,DCM/DCM_DEREG_$(hostname).scp
/opt/apxpccc/pccCrel exec,DCM/DCM_DEREG_$(hostname).scp
##unregister server from HPSA##
/opt/opsware/agent/bin/agent_uninstall.sh --no_deactivate --force
rm -r /opt/opsware
##unjoin server from BASF AD##
/root/scripts/sles_migration/basfad/./basfad_join2AD.sh -f $(hostname)