slightly better orginization ,
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Nov 2005 16:47:04 +0000 (16:47 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Nov 2005 16:47:04 +0000 (16:47 +0000)
only updating user/group when installing

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1929 dcc99617-32d9-48b4-a31d-7c20da2025e4

install.sh

index 11b0398..f4cc6ca 100755 (executable)
@@ -48,62 +48,29 @@ function fail {
 # --------------------------------------------------------------------
 # Makes sure the install directories exist and are writable
 # --------------------------------------------------------------------
-function mkInstallDirs {
-
-       if installing; then
-
-               mkdir -p "$PREFIX";
-               if [ "$?" != "0" ]; then
-                       fail "Error creating $PREFIX";
-               fi
-
-               if [ ! -w "$PREFIX" ]; then
-                       fail "We don't have write access to $PREFIX";
-               fi
 
-       fi
-
-       if building; then
-
-               mkdir -p "$TMP";
-               if [ "$?" != "0" ]; then
-                       fail "Error creating $TMP";
-               fi
-
-               if [ ! -w "$TMP" ]; then
-                       fail "We don't have write access to $TMP";
-               fi
-       fi
-
-       if installing; then
-               mkdir -p "$SOCK";
-               if [ "$?" != "0" ]; then
-                       fail "Error creating $SOCK";
-               fi
-
-               if [ ! -w "$SOCK" ]; then
-                       fail "We don't have write access to $SOCK";
-               fi
-       fi
+function mkDir {
+       mkdir -p "$1";
+       [ "$?" != "0" ] && fail "Error creating $1";
+       [ ! -w "$1" ] && fail "We don't have write access to $1";
+}
 
-       if installing; then
-               mkdir -p "$PID";
-               if [ "$?" != "0" ]; then
-                       fail "Error creating $PID";
-               fi
-               if [ ! -w "$PID" ]; then
-                       fail "We don't have write access to $PID";
-               fi
-       fi
+function mkInstallDirs {
 
+       installing      && mkDir "$PREFIX";
+       building        && mkDir "$TMP";
+       installing      && mkDir "$SOCK";
+       installing      && mkDir "$PID";
+       installing      && mkDir "$LOG";
 
 
        # add the opensrf user and group
-        if [ ! $(grep "^opensrf:" /etc/group) ]; then groupadd opensrf; fi
-        if [ ! $(grep "^opensrf:" /etc/passwd) ]; then useradd opensrf; fi
-
-        # add opensrf to the opensrf group
-        gpasswd -a opensrf opensrf
+        if installing; then
+               if [ ! $(grep "^opensrf:" /etc/group) ]; then groupadd opensrf; fi
+               if [ ! $(grep "^opensrf:" /etc/passwd) ]; then useradd opensrf; fi
+               # add opensrf to the opensrf group
+               gpasswd -a opensrf opensrf
+       fi;
 
 }