I have 2 scripts created. The first one called "lock_logoff" and it does just that. It locks the account in the script and then logs them off. The second script unlocks the account. I got tire of going over to my daughter's computer and doing this by hand when she gets grounded from the computer.
Lock script: sudo passwd -l amber sudo pkill -u amber echo "Account locked and logged off! Screaming in 3....2....1..." Unlock script: sudo passwd -u amber echo "Account unlocked!"
What I am trying to do, since there are more than 1 account on this computer, I would like to add a variable to the script so I do not have to have 3 different lock and unlock scripts. Is there a way I can run "lock_logoff jon" or "unlock amber" and it runs the script for that user?