diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2011-09-13 17:09:34 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2011-09-13 17:09:34 +0530 |
commit | 9f10e75b5cd5ef1dc2a0d166d6de6f8c0ef662a0 (patch) | |
tree | 16e7e1b9ebe87d2e4e0c3a37bfa477897ecadc75 /helper_scrips/probe.sh | |
parent | 2bd023293d115a68f5f81376d9ba1378f4ee7808 (diff) |
some helper scripts for glusterfs installation and setup
Diffstat (limited to 'helper_scrips/probe.sh')
-rwxr-xr-x | helper_scrips/probe.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/helper_scrips/probe.sh b/helper_scrips/probe.sh new file mode 100755 index 0000000..b804c7f --- /dev/null +++ b/helper_scrips/probe.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +function _init () +{ + set -u; +} + +function clean_logs () +{ + local remote_server=; + + if [ $# -eq 1 ]; then + remote_server=$1; + fi + + if [ $remote_server ]; then + gluster peer probe $remote_server; + return 0; + fi + + for i in $(cat /root/servers) + do + clean_logs $i; + done + +} + +function main () +{ + stat --printf=%i /root/servers 2>/dev/null 1>/dev/null; + if [ $? -ne 0 ]; then + echo "servers file is not present /root. Cannot execute further." + exit 1 + fi + + clean_logs; + + return 0; +} + +_init && main "$@" + + |