From 9489055dd2a881aebf2c92195f55d3207ccbc8b0 Mon Sep 17 00:00:00 2001 From: Michael James Date: Sat, 19 Nov 2016 23:41:06 -0600 Subject: [PATCH] let's just do it with one file --- installCAVE-el7.sh | 34 ---------------------------------- installCAVE.sh | 30 ++++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 42 deletions(-) delete mode 100755 installCAVE-el7.sh diff --git a/installCAVE-el7.sh b/installCAVE-el7.sh deleted file mode 100755 index 91cc5df3f9..0000000000 --- a/installCAVE-el7.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -f -# -# installCAVE-el7.sh -# -# Download awips2.repo from the Unidata web server -# -if [ ! -f /etc/yum.repos.d/awips2.repo ]; then - echo '' - echo 'Downloading awips2repo yum file to /etc/yum.repos.d/awips2.repo' - echo '' - wget -O /etc/yum.repos.d/awips2.repo http://www.unidata.ucar.edu/software/awips2/doc/el7.repo -fi - -echo "Running 'yum clean all'" -yum clean all -echo '' - -echo '' -echo "Running 'yum groupinstall awips2-cave'" -echo '' -yum groupinstall awips2-cave -y 2>&1 | tee -a /tmp/cave-install.log - -if getent passwd awips &>/dev/null; then - echo '' - echo "Setting permissions to user awips:awips" - /bin/chown -R awips:awips /awips2/cave /awips2/alertviz -else - echo '' - echo "--- user awips does not exist" - echo "--- you should set owner/group permissions for /awips2/cave and /awips2/alertviz:" - echo "tried to run 'chown -R awips:awips /awips2/cave /awips2/alertviz'" -fi -echo "" -echo "Done." diff --git a/installCAVE.sh b/installCAVE.sh index 61d20b0881..0f58791830 100755 --- a/installCAVE.sh +++ b/installCAVE.sh @@ -50,15 +50,29 @@ echo "Running 'yum groupinstall awips2-cave'" echo '' yum groupinstall awips2-cave -y 2>&1 | tee -a /tmp/cave-install.log -if getent passwd awips &>/dev/null; then - echo '' - echo "Setting permissions to user awips:fxalpha" - /bin/chown -R awips:fxalpha /awips2/cave /awips2/alertviz +if [[ $(grep "release 7" /etc/redhat-release) ]]; then + if getent passwd awips &>/dev/null; then + echo '' + echo "Setting permissions to user awips:awips" + /bin/chown -R awips:awips /awips2/cave /awips2/alertviz + else + echo '' + echo "--- user awips does not exist" + echo "--- you should set owner/group permissions for /awips2/cave and /awips2/alertviz:" + echo "tried to run 'chown -R awips:awips /awips2/cave /awips2/alertviz'" + fi + else - echo '' - echo "--- user awips does not exist" - echo "--- you should set owner/group permissions for /awips2/cave and /awips2/alertviz:" - echo "tried to run 'chown -R awips:fxalpha /awips2/cave /awips2/alertviz'" + if getent passwd awips &>/dev/null; then + echo '' + echo "Setting permissions to user awips:fxalpha" + /bin/chown -R awips:fxalpha /awips2/cave /awips2/alertviz + else + echo '' + echo "--- user awips does not exist" + echo "--- you should set owner/group permissions for /awips2/cave and /awips2/alertviz:" + echo "tried to run 'chown -R awips:fxalpha /awips2/cave /awips2/alertviz'" + fi fi echo "" echo "Done..."