summaryrefslogtreecommitdiffstats
path: root/helper_scripts/install_glusterfs_rpm.sh
diff options
context:
space:
mode:
authorM S Vishwanath Bhat <vishwanath@gluster.com>2012-01-12 23:30:00 +0530
committerM S Vishwanath Bhat <vishwanath@gluster.com>2012-01-12 23:35:15 +0530
commitf40ffd8028d3dd4f3eef4a3409c531af941d23f0 (patch)
treec2bcf865c0623761b01ca5929d8caa3c78d527bf /helper_scripts/install_glusterfs_rpm.sh
parent254e67dbd7a35d38dbe7a5f525955adeb86f5939 (diff)
renaming helper_scrips->helper_scripts and cleaning up the whitespaces
Change-Id: I6004e4066fab30e14716ef6475c1281270974d2b Signed-off-by: M S Vishwanath Bhat <vishwanath@gluster.com>
Diffstat (limited to 'helper_scripts/install_glusterfs_rpm.sh')
-rwxr-xr-xhelper_scripts/install_glusterfs_rpm.sh73
1 files changed, 73 insertions, 0 deletions
diff --git a/helper_scripts/install_glusterfs_rpm.sh b/helper_scripts/install_glusterfs_rpm.sh
new file mode 100755
index 0000000..9b5c6fa
--- /dev/null
+++ b/helper_scripts/install_glusterfs_rpm.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+ VERSION=$1;
+ if [ $# -lt 2 ]; then
+ upgrade="no";
+ else
+ if [ $2 == "yes" ]; then
+ upgrade="yes";
+ else
+ upgrade="no";
+ fi
+ fi
+}
+
+function install_glusterfs ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ ssh $remote_server cp -f /root/scripts/rpm_download_install.sh /root/;
+ ssh $remote_server /root/rpm_download_install.sh $VERSION $upgrade;
+ return 0;
+ fi
+
+ j=0;
+ for i in $(cat /root/machines)
+ do
+ j=$(($j+1));
+ (install_glusterfs $i)&
+ done
+
+}
+
+function install_my_glusterfs ()
+{
+ old_PWD=$PWD;
+
+ cd /root;
+ cp /root/scripts/rpm_download_install.sh /root/;
+ /root/rpm_download_install.sh $VERSION $upgrade;
+
+ cd $old_PWD;
+ return 0;
+}
+
+function main ()
+{
+ stat --printf=%i /root/machines 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further.";
+
+ exit 1;
+ fi
+
+ install_glusterfs;
+ for i in $(1 $j)
+ do
+ wait %$j;
+ done
+
+ install_my_glusterfs;
+
+ return 0;
+}
+
+_init "$@" && main "$@"