From 7bd6e0f78750398e81559834560781607c7cf8b5 Mon Sep 17 00:00:00 2001 From: Michael Mrozek Date: Wed, 21 Apr 2010 05:05:39 +0200 Subject: [PATCH] op_usermanager: Changed it to make use of /tmp/currentuser instead of the xfce4-User --- recipes/pandora-system/pandora-scripts/op_usermanager.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/pandora-system/pandora-scripts/op_usermanager.sh b/recipes/pandora-system/pandora-scripts/op_usermanager.sh index 65a99e3..6371d99 100755 --- a/recipes/pandora-system/pandora-scripts/op_usermanager.sh +++ b/recipes/pandora-system/pandora-scripts/op_usermanager.sh @@ -38,13 +38,13 @@ EOF fi fi elif [ ${selection} = "remove" ]; then - xfceuser=$(ps u -C xfce4-session | tail -n1 | awk '{print $1}') + user2=$(cat /tmp/currentuser) echo "Remove User" amount=$(cat /etc/passwd | grep /home/ | grep -v root | awk -F\: '{print $1 }' | wc -l) if [ ${amount} = "1" ]; then zenity --title="Error" --error --text="Sorry! You can't remove the last normal user!" --timeout 6 else - if selection=$(cat /etc/passwd | grep /home/ | grep -v root | grep -v $xfceuser | awk -F\: '{print $1 }' | zenity --width=100 --height=200 --title="Select the user to delete" --list --column "Username" --text "Select the user to delete\n\nPlease note: You can't remove the user that is currently logged in.") ; then + if selection=$(cat /etc/passwd | grep /home/ | grep -v root | grep -v $user2 | awk -F\: '{print $1 }' | zenity --width=100 --height=200 --title="Select the user to delete" --list --column "Username" --text "Select the user to delete\n\nPlease note: You can't remove the user that is currently logged in.") ; then if zenity --question --title="Confirm User Removal" --text="Are you REALLY sure you want to remove the user $selection?\n\nThere will be NO other confirmation and this can NOT be undone!" --ok-label="Yes, remove user!" --cancel-label="Don't remove the user"; then echo "Really remove $selection" userdel -fr $selection -- 2.39.5