Skip to content
Snippets Groups Projects
Commit bd36c616 authored by Bob Mottram's avatar Bob Mottram
Browse files

Can't remove admin user from webadmin

parent 1c6bfe1c
No related branches found
No related tags found
No related merge requests found
......@@ -1042,13 +1042,16 @@ function add_remove_users {
if [ ${#remove_username} -le 32 ]; then
if valid_username_characters "$remove_username"; then
if [ -d "/home/$remove_username" ]; then
check_for_existing_processes $remove_user_script
{ echo "/usr/local/bin/${PROJECT_NAME}-rmuser $remove_username > $webadmin_install_dir/log.txt";
echo "exit 0"; } >> $remove_user_script
chmod +x $remove_user_script
admin_username=$(grep 'MY_USERNAME=' "$CONFIGURATION_FILE" | head -n 1 | awk -F '=' '{print $2}')
if [[ "$remove_username" != "$admin_username" ]]; then
check_for_existing_processes $remove_user_script
{ echo "/usr/local/bin/${PROJECT_NAME}-rmuser $remove_username > $webadmin_install_dir/log.txt";
echo "exit 0"; } >> $remove_user_script
chmod +x $remove_user_script
# run in a separate process
./$remove_user_script &
# run in a separate process
./$remove_user_script &
fi
fi
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment