Hey.
Based on code from another thread I've made this:
Code:
#!/bin/sh
DIALOG=Xdialog
$DIALOG --title "Logout options" \
--menu "choose:" 0 0 3\
"reboot" "Reboot the box" \
"poweroff" "Shut down the box" 2>/tmp/logoutbox.tmp.$$
retval=$?
choice=`cat /tmp/logoutbox.tmp.$$`
rm -f /tmp/logoutbox.tmp.$$
case $retval in
0)
$choice ;;
1)
echo "Cancel pressed.";;
255)
echo "Box closed.";;
esac
When running it from xterm it works just fine, reboot and poweroff is all dandy, but not when running it from the fluxbox menu. I get a dialog box, but for some reason it doesn't poweroff or reboot. The menu entry is like this:
Code:
[exec] (Logout) {./logoutbox.sh}
When exiting X I can see an error message close to this; reboot: command not found
Same with poweroff. I am certain that they exist since I can issue them from xterm. Any ideas?
Btw, Im using Fluxbox 0.9.10 on Slackware 10.
Regards.