diff options
author | Jonathan Bauer | 2015-04-07 13:51:00 +0200 |
---|---|---|
committer | Jonathan Bauer | 2015-04-07 13:51:00 +0200 |
commit | 6bf34232abf59842dde6916d551343e294013add (patch) | |
tree | 7cdb2f1fdeab1dfd6dd03d498b57b0fc19f58551 | |
parent | [pam-common-share] removed bash specifics in pam-common-share scripts (diff) | |
download | tm-scripts-6bf34232abf59842dde6916d551343e294013add.tar.gz tm-scripts-6bf34232abf59842dde6916d551343e294013add.tar.xz tm-scripts-6bf34232abf59842dde6916d551343e294013add.zip |
[pam-common-share] fix bad variable name and typo
-rw-r--r-- | remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share b/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share index 9600fa4d..a492e248 100644 --- a/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share +++ b/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share @@ -109,7 +109,6 @@ mount_share() { # always unset credentials unset USER unset PASSWD - elid fi } @@ -145,20 +144,20 @@ for SHARE in $(grep -E '^SLX_SHARE_[0-9]+_PATH=.*$' /opt/openslx/config); do # let's extract the number of the share. # i.e. SLX_SHARE_0_PATH -> share number 0 # first just cut everything after '=' - SHARE_NUM="$(echo $SHARE | awk -F '=' '{print $1}')" + SHARE_ID="$(echo $SHARE | awk -F '=' '{print $1}')" # now strip the leading SLX_SHARE_ - SHARE_NUM=${SHARE_NUM#SLX_SHARE_} + SHARE_ID=${SHARE_ID#SLX_SHARE_} # now remove the trailing _PATH - SHARE_NUM=${SHARE_NUM%_PATH} + SHARE_ID=${SHARE_ID%_PATH} # now it should be a number, TODO accept more than numbers? Doesn't really matter... # this check is mostly to be sure that the variable splitting worked as it should # ugly cause we need to be ash compatible ... - if ! echo "${SHARE_NUM}" | grep -q -E '^[0-9]+$'; then + if ! echo "${SHARE_ID}" | grep -q -E '^[0-9]+$'; then continue fi # now do try to mount the share using the helper function defined on the top of this script - eval mount_share \""\$SLX_SHARE_${SHARE_NUM}_AUTH_TYPE"\" \""\$SLX_SHARE_${SHARE_NUM}_AUTH_USER"\" \""\$SLX_SHARE_${SHARE_NUM}_AUTH_PASS"\" \""\$SLX_SHARE_${SHARE_NUM}_PERM"\" \""\$SLX_SHARE_${SHARE_NUM}_PATH"\" \""$SHARE_NUM"\" + eval mount_share \""\$SLX_SHARE_${SHARE_ID}_AUTH_TYPE"\" \""\$SLX_SHARE_${SHARE_ID}_AUTH_USER"\" \""\$SLX_SHARE_${SHARE_ID}_AUTH_PASS"\" \""\$SLX_SHARE_${SHARE_ID}_PERM"\" \""\$SLX_SHARE_${SHARE_ID}_PATH"\" \""$SHARE_ID"\" ## unset USER and PASSWD just in case mount_share returned due to an error. unset USER unset PASSWD |