diff options
Diffstat (limited to 'move/tree')
-rwxr-xr-x | move/tree/X_move | 2 | ||||
-rwxr-xr-x | move/tree/halt_reboot | 10 | ||||
-rwxr-xr-x | move/tree/startkde_move | 8 |
3 files changed, 19 insertions, 1 deletions
diff --git a/move/tree/X_move b/move/tree/X_move index df085fcd8..a5969ed9a 100755 --- a/move/tree/X_move +++ b/move/tree/X_move @@ -1,7 +1,7 @@ #!/bin/bash ok=0 -while [ "$ok" == 0 ]; do +while [ "$ok" == 0 -a ! -f /tmp/reboot ]; do X $@ ok=$? done diff --git a/move/tree/halt_reboot b/move/tree/halt_reboot new file mode 100755 index 000000000..d31032fe6 --- /dev/null +++ b/move/tree/halt_reboot @@ -0,0 +1,10 @@ +#!/bin/sh + +sudo killall -USR1 startkde_move + +if [ $UID == 0 ]; then + user=`getent passwd 501 | perl -ne 'print $1 if /([^:]+):/'` + su $user -c 'dcop kdesktop default logout' +else + dcop kdesktop default logout +fi
\ No newline at end of file diff --git a/move/tree/startkde_move b/move/tree/startkde_move index 9169add40..402803b5e 100755 --- a/move/tree/startkde_move +++ b/move/tree/startkde_move @@ -1,5 +1,13 @@ #!/bin/sh +#- exit cleanly on SIGUSR1, so that our init can see a clean shutdown and automatically reboot +reboot () { + touch /tmp/reboot + sudo killall X + exit 0 +} +trap 'reboot' SIGUSR1 + while true; do wait4x || exit 1 xwait -permanent & |