#!/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 "Create Share" \ 4 "Remove Share" \ 5 "Exit" 2>"$TMP_FILE" CHOICE=$(<"$TMP_FILE") case $CHOICE in 1) bash $SMB_TOOLS_PATH/gui/dialog_user_add.sh ;; 2) bash $SMB_TOOLS_PATH/gui/dialog_user_remove.sh ;; 3) bash $SMB_TOOLS_PATH/gui/dialog_share_create.sh ;; 4) bash $SMB_TOOLS_PATH/gui/dialog_share_remove.sh ;; 5) break ;; *) dialog --msgbox "Invalid option." 8 30 ;; esac done clear rm -f "$TMP_FILE" echo "Exited."