Cleanup post-boot cluster configuration
[autocluster.git] / base / all / root / scripts / nsd_server_common.bash
1 # If there are sofs_storage nodes in the cluster (meaning that other
2 # sofs_* nodes will not have direct-attached storage) then scripts
3 # that include this snippet must be run on one of the storage nodes.
4 # Therefore, in the case, this snippet tries to determine if it is
5 # running on the 1st NSD server and, if not, attempts to run the
6 # script there.
7
8 nsd_servers="@@NSD_SERVERS@@"
9
10 if [ -n "$nsd_servers" -a \
11     "${HOSTNAME%%.*}" != "${nsd_servers%%[.,]*}" ] ; then
12     if [ "${0#/}" != "$0" ] ; then 
13         script="$0"
14     else
15         script="${PWD}/${0}"
16     fi
17     exec ssh "${nsd_servers%%[.,]*}" "$script" "$@"
18 fi