From 3b0dacdba643d32a2aafcc3fc8b3cd20fa7ece39 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Thu, 3 Jan 2019 00:16:10 +0100 Subject: [PATCH] Add accounts menu --- config/accounts/menu | 22 ++++++++++++++++++++++ config/{ => accounts}/sudoers/menu | 0 config/{ => accounts}/users/menu | 0 config/menu | 6 ++---- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 config/accounts/menu rename config/{ => accounts}/sudoers/menu (100%) rename config/{ => accounts}/users/menu (100%) diff --git a/config/accounts/menu b/config/accounts/menu new file mode 100644 index 0000000..47d1fbd --- /dev/null +++ b/config/accounts/menu @@ -0,0 +1,22 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Users" "") +options+=("Sudoers" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Accounts Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Users') menu config/accounts/users/menu;; + 'Sudoers') menu config/accounts/sudoers/menu;; +esac + +exit 0 diff --git a/config/sudoers/menu b/config/accounts/sudoers/menu similarity index 100% rename from config/sudoers/menu rename to config/accounts/sudoers/menu diff --git a/config/users/menu b/config/accounts/users/menu similarity index 100% rename from config/users/menu rename to config/accounts/users/menu diff --git a/config/menu b/config/menu index 96415bb..1f7b7f2 100644 --- a/config/menu +++ b/config/menu @@ -4,8 +4,7 @@ options=() options+=("Bash" "") options+=("Firewall" "") -options+=("Users" "") -options+=("Sudoers" "") +options+=("Accounts" "") options+=("Systemd" "") if [ -f /usr/bin/Xorg ]; then options+=("XOrg" "") @@ -24,8 +23,7 @@ sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 case $sel in 'Bash') menu config/bash/menu;; 'Firewall') menu config/firewall/menu;; - 'Users') menu config/users/menu;; - 'Sudoers') menu config/sudoers/menu;; + 'Accounts') menu config/accounts/menu;; 'Systemd') menu config/systemd/menu;; 'XOrg') menu config/xorg/menu;; 'Boot') menu config/boot/menu;;