Tue Oct 21, 2014 2:08 pm
# squeeze (or other distro) might have used(***/***)etc/sudoers
if grep -qs $oldusername /target(***/***)etc/sudoers ; then
sed -i "/$oldusername/d" /target(***/***)etc/sudoers
fi
#!/usr/bin/env bash
# quit-dialogue.4
# For openbox, xscreensaver. Need sudo allowed for halt and reboot.
yad --question --title="Exit Choices" \
--width=350 --height=60 \
--button="Lock Screen":0 --button="Logout":1 \
--button="Reboot":2 --button="Shutdown":3 --button=gtk-close:4
answer="$?"
case $answer in
0) xscreensaver-command -lock ;;
1) openbox --exit ;;
2) sudo /sbin/reboot ;;
3) sudo /sbin/halt ;;
4) exit 0 ;;
esac
exit 0
# Cmnd alias specification
Cmnd_Alias HALT = /sbin/shutdown, /sbin/halt
Cmnd_Alias REBOOT = /sbin/reboot
Cmnd_Alias MEM = /usr/local/bin/ps_mem.py
# User privilege specification
root ALL=(ALL:ALL) ALL
user ALL=NOPASSWD: HALT, REBOOT, MEM, NET
Tue Oct 21, 2014 2:52 pm
user ALL= NOPASSWD: /usr/sbin/pm-suspend, /usr/sbin/pm-hibernate, /sbin/halt, /sbin/reboot
xhost SI:localuser:root && sudo command && xhost -SI:localuser:root
Wed Oct 22, 2014 7:16 pm
su
chown root:root /copy/of/halt
chmod 6711 /copy/of/halt