Scotch Linux arbre1 fly maison ScotchLinux... arbre

Remarque: La redirection de stdout vers stderr


#!/bin/bash
function set_xdm(){
sudo /etc/init.d/xdm "$1"
test -n "$2" && sudo shutdown "$2" now 2>&1
}
xscreensaver-command -exit
for $PID in "parcellite" "conky" "idesk" "bbkeys"; do
test -n $(pidof $PID) && killall -9 $PID
done;
case $1 in
shutdown)
set_xdm "stop" "-h"
;;
reboot)
set_xdm "stop" "-r"
;;
xdm)
set_xdm "restart"
;;
esac