Force option on user removal
This commit is contained in:
parent
91ae203b8e
commit
b8c0bce0f1
|
@ -212,7 +212,7 @@ do
|
|||
retval=$(add_user_${app_name} "$ADD_USERNAME" "$NEW_USER_PASSWORD")
|
||||
if [[ $retval != '0' ]]; then
|
||||
echo $"Failed with error code ${retval}"
|
||||
${PROJECT_NAME}-rmuser $ADD_USERNAME
|
||||
${PROJECT_NAME}-rmuser $ADD_USERNAME --force
|
||||
exit 672392
|
||||
fi
|
||||
if ! grep -q "${app_name}_${ADD_USERNAME}" $APP_USERS_FILE; then
|
||||
|
|
|
@ -51,6 +51,7 @@ done
|
|||
read_config_param MY_USERNAME
|
||||
|
||||
REMOVE_USERNAME=$1
|
||||
REMOVE_OPTIONS="$2"
|
||||
|
||||
if [ ! $REMOVE_USERNAME ]; then
|
||||
echo $'Please specify a username to remove'
|
||||
|
@ -93,11 +94,15 @@ if [[ $REMOVE_USERNAME == $ADMIN_USERNAME ]]; then
|
|||
exit 8
|
||||
fi
|
||||
|
||||
echo $'>>> REMOVE USER <<<'
|
||||
read -p $"Do you really wish to remove the user '$REMOVE_USERNAME' (y/n) ?" yn
|
||||
if [[ $yn != 'y' && $yn != 'Y' && $yn != 'yes' && $yn != 'Yes' && $yn != 'YES' ]]; then
|
||||
echo $"User $REMOVE_USERNAME was not removed"
|
||||
exit 9
|
||||
if [[ "$REMOVE_OPTIONS" != '-f' && "$REMOVE_OPTIONS" != '-y' && "$REMOVE_OPTIONS" != '--force' ]]; then
|
||||
echo $'>>> REMOVE USER <<<'
|
||||
read -p $"Do you really wish to remove the user '$REMOVE_USERNAME' (y/n) ?" yn
|
||||
if [[ $yn != 'y' && $yn != 'Y' && $yn != 'yes' && $yn != 'Yes' && $yn != 'YES' ]]; then
|
||||
echo $"User $REMOVE_USERNAME was not removed"
|
||||
exit 9
|
||||
fi
|
||||
else
|
||||
echo $"Forced removal of user $REMOVE_USERNAME"
|
||||
fi
|
||||
|
||||
if [ -f /etc/nginx/.htpasswd ]; then
|
||||
|
|
Loading…
Reference in New Issue