X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fshare%2Fma%2Fupdate_users;h=c180b5689717e0e3b1810478b0ac7957ecd6ad78;hb=48cb182a7d0265aabed84d74b010ff0b24fa078c;hp=e9e3cc60387f899469c1361ae12d56c4bde3d0cc;hpb=89e447e2001c0406fab6d2e6ca300a19d492435b;p=monkeysphere.git diff --git a/src/share/ma/update_users b/src/share/ma/update_users index e9e3cc6..c180b56 100644 --- a/src/share/ma/update_users +++ b/src/share/ma/update_users @@ -13,6 +13,7 @@ update_users() { +local returnCode=0 local unames local uname local authorizedKeysDir @@ -26,8 +27,6 @@ else unames=$(getent passwd | cut -d: -f1) fi -RETURN=0 - # set mode MODE="authorized_keys" @@ -35,7 +34,7 @@ MODE="authorized_keys" GNUPGHOME="$GNUPGHOME_SPHERE" # the authorized_keys directory -authorizedKeysDir="${MADATADIR}/authorized_keys" +authorizedKeysDir="${SYSDATADIR}/authorized_keys" # check to see if the gpg trust database has been initialized if [ ! -s "${GNUPGHOME}/trustdb.gpg" ] ; then @@ -93,8 +92,8 @@ for uname in $unames ; do # process authorized_user_ids file, as monkeysphere user su_monkeysphere_user \ - ". ${SYSSHAREDIR}/common; process_authorized_user_ids $TMP_AUTHORIZED_USER_IDS" - RETURN="$?" + ". ${SYSSHAREDIR}/common; process_authorized_user_ids $TMP_AUTHORIZED_USER_IDS" \ + || returnCode="$?" else log debug "not processing authorized_user_ids." fi @@ -141,7 +140,7 @@ for uname in $unames ; do log error "Failed to install authorized_keys for '$uname'!" rm -f "${authorizedKeysDir}/${uname}" # indicate that there has been a failure: - RETURN=1 + returnCode=1 } else rm -f "${authorizedKeysDir}/${uname}" @@ -154,4 +153,5 @@ for uname in $unames ; do rm -rf "$TMPLOC" done +return $returnCode }