Basically a good idea, but I wouldn't bother with customization or with copying scripts to /etc/init.d/. You would also have to make sure that the script is not run at startup. Too much trouble. I also suggest to change not only PUPMODE 5 to 12. All users could benefit from a change to PUPMODE 12, well...maybe except those who are running it already.jrb wrote:don't have a pupsave file but use thisin a script in /etc/init.d/. It's in my custom built adrive with PHATslacko5502.Code: Select all
sed -i 's|PUPMODE=5|PUPMODE=12|' /etc/rc.d/PUPSTATE
Putting this all together could look like this
Code: Select all
#!/bin/sh
ANSWER=`Xdialog --item-help --no-tags --title "$0" --stdout --radiolist "Select shutdown method" 300x200 5 \
"tag1" "Power-off SUPERFAST, No save" "on" "Does not save anything. Immediately powers off without going through Puppy's various shutdown routines" \
"tag2" "Power-off Normal, No save" "off" "Normal shutdown, but PUPMODE changed to PUPMODE=12, thus Puppy will not offer to save." \
"tag3" "Power-off Normal" "off" "Normal shutdown" \
`
EC=$?
if [ $EC = 0 ] ; then # errorcode 0=yes ; 255=close icon , 1=No or ESC key
case $ANSWER in
tag1)
rm /etc/.XLOADED
exec /bin/busybox poweroff
;;
tag2)
sed -i 's|PUPMODE=[0-9]*|PUPMODE=12|' /etc/rc.d/PUPSTATE
exec wmpoweroff
;;
tag3)
exec wmpoweroff
;;
*)
esac
fi
exit