Added suspend option

pull/3/head
Ghost1227 15 years ago
parent 37a09937db
commit 09d852e44e

@ -14,3 +14,10 @@ Version 0.3 (2009-11-18)
- Fixed an issue with allowshutdown off and allowconsole on
- Code cleanup (thanks Brisbin33)
- Fixed issue with profile.d execution order
Version 0.3.1 (2009-11-20)
- Added failsafe to startup script that overrides execution if
logged in as root
Version 0.3.2 (2009-11-21)
- Added suspend option

@ -24,7 +24,7 @@
# MA 02110-1301, USA.
name="Console Display Manager"
ver="0.3.1"
ver="0.3.2"
info="\e[1;34m==>\e[1;37m"
error="\e[1;31m==>\e[1;37m"
success="\e[1;32m==>\e[1;37m"
@ -140,19 +140,28 @@ mainmenu() {
}
shutdownmenu() {
haltmenu="0 Shutdown 1 Reboot"
# Check if suspend is enabled
if [[ ${allowsuspend} == "yes" ]]; then
haltmenu=$(echo -n "${haltmenu} 2 Suspend ")
fi
# Display shutdown dialog
haltopt=$(
dialog --colors --backtitle "${name} v${ver}" --stdout \
--ok-label " Select " --cancel-label " Cancel " \
--menu "Shutdown" 0 0 0 0 Shutdown 1 Reboot
--menu "Shutdown" 0 0 0 ${haltmenu}
)
if [[ $? == 0 ]]; then
clear
if [[ ${haltopt} -eq 0 ]]; then
${shutdowncommand}
else
elif [[ ${haltopt} -eq 1 ]]; then
${rebootcommand}
else
${suspendcommand}
fi
else
mainmenu

@ -19,6 +19,12 @@ allowshutdown=yes
shutdowncommand='sudo shutdown -h now'
rebootcommand='sudo shutdown -r now'
# Allow suspend?
# Note that this option requires pm-utils
# to be installed and properly configured.
allowsuspend=yes
suspendcommand='sudo pm-suspend'
# Set configuration for specific users?
userconfig=(courtney)

Loading…
Cancel
Save