#!/bin/bash TMP_FILE=$(mktemp) TITLE="System Administration Tool" while true; do dialog --clear \ --backtitle "$TITLE" \ --title "Main Menu" \ --menu "Choose an action:" 15 50 6 \ 1 "Add User" \ 2 "Remove User" \ 3 "List Users" \ 4 "Create Share" \ 5 "Remove Share" \ 6 "Exit" 2>"$TMP_FILE" CHOICE=$(<"$TMP_FILE") case $CHOICE in 1) ./dialog_user_add.sh ;; 2) ./dialog_user_remove.sh ;; 3) ./dialog_user_list.sh ;; 4) ./dialog_share_create.sh ;; 5) dialog --inputbox "Enter share name to remove:" 10 40 2>"$TMP_FILE" SHARE=$(<"$TMP_FILE") dialog --msgbox "Share '$SHARE' would be removed." 8 40 ;; 6) break ;; *) dialog --msgbox "Invalid option." 8 30 ;; esac done clear rm -f "$TMP_FILE" echo "Exited."