Cybersecurity
DevOps Cloud (ADM)
IT Operations Cloud
#Cluster unload GroupWise Domain resource
#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
# define the IP address
RESOURCE_IP=192.168.1.1
# define the file system type
MOUNT_FS=ext3
#define the volume group name
VOLGROUP_NAME=vmta
# define the device
MOUNT_DEV=/dev/vmta/vmta
# define the mount point
MOUNT_POINT=/media/ext3/vmta
# define NCP server name
NCP_SERVER=c-lnx-mail-vmta-server
# define NCP volume name
NCP_VOLUME=vmta
# Stop domain
ignore_error /etc/init.d/grpwise stop gwdom
# Checking running status <--------- HERE
while [[ `rcgrpwise status gwdom|grep running` == 'Checking status [gwdom]..running' ]]; do sleep 1;done
# Kill domain process
pkill -fx "/opt/novell/groupwise/agents/bin/gwdom @/media/ext3/vmta/vmta/groupwise/agents/share/gwdom.mta"
# Remove GroupWise Domain Secondary IP address
ignore_error del_secondary_ipaddress 192.168.1.2
# Unbind ncpcon
ignore_error ncpcon unbind --ncpservername=$NCP_SERVER --ipaddress=$RESOURCE_IP
# dismount the NCP volume
ignore_error ncpcon dismount $NCP_VOLUME
# Remove resources the IP address
ignore_error del_secondary_ipaddress $RESOURCE_IP
# Close volume
fuser -km $MOUNT_POINT
# unmount the volume
exit_on_error umount_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS
# deactivate the volume group
exit_on_error vgchange -a en $VOLGROUP_NAME
ignore_error rmdir $MOUNT_POINT
exit 0