quiet
This commit is contained in:
parent
aa81bb930e
commit
bfd2a37f63
|
@ -65,7 +65,7 @@ function add_user_tahoelafs {
|
||||||
new_username="$1"
|
new_username="$1"
|
||||||
new_user_password="$2"
|
new_user_password="$2"
|
||||||
${PROJECT_NAME}-pass -u $new_username -a tahoelafs -p "$new_user_password"
|
${PROJECT_NAME}-pass -u $new_username -a tahoelafs -p "$new_user_password"
|
||||||
if grep "${new_username}:" /etc/nginx/.htpasswd-tahoelafs; then
|
if grep -q "${new_username}:" /etc/nginx/.htpasswd-tahoelafs; then
|
||||||
sed -i '/${new_username}:/d' /etc/nginx/.htpasswd-tahoelafs
|
sed -i '/${new_username}:/d' /etc/nginx/.htpasswd-tahoelafs
|
||||||
fi
|
fi
|
||||||
echo "${new_user_password}" | htpasswd -i -s /etc/nginx/.htpasswd-tahoelafs ${new_username}
|
echo "${new_user_password}" | htpasswd -i -s /etc/nginx/.htpasswd-tahoelafs ${new_username}
|
||||||
|
@ -75,7 +75,7 @@ function add_user_tahoelafs {
|
||||||
function remove_user_tahoelafs {
|
function remove_user_tahoelafs {
|
||||||
remove_username="$1"
|
remove_username="$1"
|
||||||
${PROJECT_NAME}-pass -u $remove_username --rmapp tahoelafs
|
${PROJECT_NAME}-pass -u $remove_username --rmapp tahoelafs
|
||||||
if grep "${remove_username}:" /etc/nginx/.htpasswd-tahoelafs; then
|
if grep -q "${remove_username}:" /etc/nginx/.htpasswd-tahoelafs; then
|
||||||
sed -i '/${remove_username}:/d' /etc/nginx/.htpasswd-tahoelafs
|
sed -i '/${remove_username}:/d' /etc/nginx/.htpasswd-tahoelafs
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ function change_password_tahoelafs {
|
||||||
change_username="$1"
|
change_username="$1"
|
||||||
change_password="$2"
|
change_password="$2"
|
||||||
${PROJECT_NAME}-pass -u $change_username -a tahoelafs -p "$change_password"
|
${PROJECT_NAME}-pass -u $change_username -a tahoelafs -p "$change_password"
|
||||||
if grep "${change_username}:" /etc/nginx/.htpasswd-tahoelafs; then
|
if grep -q "${change_username}:" /etc/nginx/.htpasswd-tahoelafs; then
|
||||||
sed -i '/tahoe-${change_username}:/d' /etc/nginx/.htpasswd-tahoelafs
|
sed -i '/tahoe-${change_username}:/d' /etc/nginx/.htpasswd-tahoelafs
|
||||||
fi
|
fi
|
||||||
echo "${change_password}" | htpasswd -i -s /etc/nginx/.htpasswd-tahoelafs ${change_username}
|
echo "${change_password}" | htpasswd -i -s /etc/nginx/.htpasswd-tahoelafs ${change_username}
|
||||||
|
|
Loading…
Reference in New Issue