Permalink
Browse files

on update, check :

- directories
- unix user / unix group
- sshgate unix home directory
  • Loading branch information...
1 parent 9bf74ac commit d416698211d1e467975a45b732b4569766f9fab9 @Tauop committed Feb 20, 2012
Showing with 22 additions and 25 deletions.
  1. +22 −25 build-utils/install.sh
View
@@ -146,38 +146,35 @@ OK
DOTHIS 'Installing sshGate'
- if [ "${action}" = 'install' ]; then
-
- # create directories
- MK () { [ ! -d "$1/" ] && mkdir -p "$1"; }
- for dir in $( SETUP_GET_DIRECTORY_VARIABLES ); do
- MK "$( eval "echo \"\${${dir}}\"" )"
- done
-
- # Create sshGate unix account
- grep "^${SSHGATE_GATE_ACCOUNT}:" /etc/passwd >/dev/null 2>/dev/null
+ # create directories
+ MK () { [ ! -d "$1/" ] && mkdir -p "$1"; }
+ for dir in $( SETUP_GET_DIRECTORY_VARIABLES ); do
+ MK "$( eval "echo \"\${${dir}}\"" )"
+ done
+
+ # Create sshGate unix account
+ grep "^${SSHGATE_GATE_ACCOUNT}:" /etc/passwd >/dev/null 2>/dev/null
+ if [ $? -ne 0 ]; then
+ useradd "${SSHGATE_GATE_ACCOUNT}" 2>/dev/null
if [ $? -ne 0 ]; then
- useradd "${SSHGATE_GATE_ACCOUNT}" 2>/dev/null
- if [ $? -ne 0 ]; then
- echo "ERROR: Can't create ${SSHGATE_GATE_ACCOUNT} unix account"
- exit 1;
- fi
+ echo "ERROR: Can't create ${SSHGATE_GATE_ACCOUNT} unix account"
+ exit 1;
fi
+ fi
- # Create sshGate unix group
- grep "^${SSHGATE_GATE_ACCOUNT}:" /etc/group >/dev/null 2>/dev/null
+ # Create sshGate unix group
+ grep "^${SSHGATE_GATE_ACCOUNT}:" /etc/group >/dev/null 2>/dev/null
+ if [ $? -ne 0 ]; then
+ groupadd "${SSHGATE_GATE_ACCOUNT}" 2>/dev/null
if [ $? -ne 0 ]; then
- groupadd "${SSHGATE_GATE_ACCOUNT}" 2>/dev/null
- if [ $? -ne 0 ]; then
- echo "ERROR: Can't create ${SSHGATE_GATE_ACCOUNT} unix account"
- exit 1;
- fi
+ echo "ERROR: Can't create ${SSHGATE_GATE_ACCOUNT} unix account"
+ exit 1;
fi
-
- home_dir=$( cat /etc/passwd | grep "^${SSHGATE_GATE_ACCOUNT}:" | cut -d':' -f6 )
- MK "${home_dir}/.ssh/"
fi
+ home_dir=$( cat /etc/passwd | grep "^${SSHGATE_GATE_ACCOUNT}:" | cut -d':' -f6 )
+ MK "${home_dir}/.ssh/"
+
# install stuff
cp -r ./bin/ ./data/ COPYING "${SSHGATE_DIRECTORY}/"
[ -d ./tests/ ] && cp -r ./tests/ "${SSHGATE_DIR_BIN}/"

0 comments on commit d416698

Please sign in to comment.