Some minor changes on scripts 'add_user_to_group.sh' and 'remove_user_from_group.sh'.

This commit is contained in:
Christoph 2020-10-21 21:02:46 +02:00
parent b1910a03c5
commit 14f8ed9acb
2 changed files with 15 additions and 2 deletions

View File

@ -450,13 +450,20 @@ echo ""
# -
echononl " Add user \033[37m\033[1m$USER\033[m to group \033[37m\033[1m$GROUP\033[m .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER' " -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER'" -s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
blank_line
echo ""
echo -e "\033[37m\033[1mcommandline was:\033[m"
echo "su -c \"/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER'\" -s /bin/bash $HTTP_USER"
blank_line
warn "Despite errors, it is possible that the user \033[37m\033[1m$USER\033[m was added to the group \033[37m\033[1m$GROUP\033[m"
fatal "$(cat $log_file)"
fi
blank_line
clean_up 0

View File

@ -450,11 +450,17 @@ echo ""
# -
echononl " Remove user \033[37m\033[1m$USER\033[m from group \033[37m\033[1m$GROUP\033[m .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER' " -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER'" -s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
blank_line
echo ""
echo -e "\033[37m\033[1mcommandline was:\033[m"
echo -e "su -c \"/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER'\" -s /bin/bash $HTTP_USER"
blank_line
warn "Despite errors, it is possible that the user \033[37m\033[1m$USER\033[m was removed from the group \033[37m\033[1m$GROUP\033[m"
fatal "$(cat $log_file)"
fi