diff options
| author | Martin Schwenke <martin@meltin.net> | 2009-07-24 14:59:08 +1000 |
|---|---|---|
| committer | Martin Schwenke <martin@meltin.net> | 2009-07-24 14:59:08 +1000 |
| commit | 89d86e938c79308ecf760caca67bfa3c4e4050e7 (patch) | |
| tree | 5856baa632f7b4b2184ece6c65b5057ca87708e0 /base/root/scripts/nsd_server_common.bash | |
| parent | 6e792eb3039a381faffb020a8e10553c6c25d29a (diff) | |
| parent | 9d424e19d7235eb6162605ef888b4b5f36230f4a (diff) | |
Merge branch 'master' into merged_kickstart
Diffstat (limited to 'base/root/scripts/nsd_server_common.bash')
| -rw-r--r-- | base/root/scripts/nsd_server_common.bash | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/base/root/scripts/nsd_server_common.bash b/base/root/scripts/nsd_server_common.bash new file mode 100644 index 0000000..d665c59 --- /dev/null +++ b/base/root/scripts/nsd_server_common.bash @@ -0,0 +1,18 @@ +# If there are sofs_storage nodes in the cluster (meaning that other +# sofs_* nodes will not have direct-attached storage) then scripts +# that include this snippet must be run on one of the storage nodes. +# Therefore, in the case, this snippet tries to determine if it is +# running on the 1st NSD server and, if not, attempts to run the +# script there. + +nsd_servers="@@NSD_SERVERS@@" + +if [ -n "$nsd_servers" -a \ + "${HOSTNAME%%.*}" != "${nsd_servers%%[.,]*}" ] ; then + if [ "${0#/}" != "$0" ] ; then + script="$0" + else + script="${PWD}/${0}" + fi + exec ssh "${nsd_servers%%[.,]*}" "$script" "$@" +fi |
