obosdi-pkg/config/menu

33 lines
731 B
Text
Raw Normal View History

2015-08-20 22:37:06 +02:00
#!/bin/bash
. ./lib
options=()
options+=("Bash" "")
options+=("Firewall" "")
2019-01-03 00:16:10 +01:00
options+=("Accounts" "")
2018-09-16 00:20:14 +02:00
options+=("Systemd" "")
if [ -f /usr/bin/Xorg ]; then
options+=("XOrg" "")
fi
2019-01-03 00:10:33 +01:00
options+=("Boot" "")
2015-08-20 22:37:06 +02:00
defaultitem=""
2022-11-10 22:27:23 +01:00
sel=$(dialog --backtitle "$apptitle" --title "Config Menu :" --default-item "$defaultitem" --cancel-button "Back" --menu "" 0 0 0 \
2015-08-20 22:37:06 +02:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
exit 1
fi
sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0
case $sel in
'Bash') menu config/bash/menu;;
'Firewall') menu config/firewall/menu;;
2019-01-03 00:16:10 +01:00
'Accounts') menu config/accounts/menu;;
2018-09-16 00:20:14 +02:00
'Systemd') menu config/systemd/menu;;
2015-08-20 22:37:06 +02:00
'XOrg') menu config/xorg/menu;;
2019-01-03 00:10:33 +01:00
'Boot') menu config/boot/menu;;
2015-08-20 22:37:06 +02:00
esac
exit 0