-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
29 lines (26 loc) · 1.02 KB
/
main.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#
# This program designed to help you to add/modifiy/delete/view users/groups with multipule options.
# The script mainly use (whiptail) tool to interact with user.
# Must run as a root or sudo with suitable permissions.
#
# Created By: Abdalla Hamdy
# Github: https://github.com/xAbdalla
# LinkedIn: https://www.linkedin.com/in/abdallahamdy
#
# Comment: Feel free to fork and edit it if you like.
## Check if this script is running as root.
if [ $(id -u) -ne 0 ]; then
whiptail --title "Privileges Error!" --msgbox "Error! Please run as root user." 8 78
exit
fi
## Important Package to view menues and resize them.
dnf -qy install newt # Provides (whiptail)
dnf -qy install xterm-resize # Provides (resize)
if (whiptail --title "System Admin Helper" --yesno "Start the program?" 8 78); then
## Start the program with the first (main) menu.
./scripts/main-menu.sh; exit
else
## If the user choose to not continue.
whiptail --title "Bye Bye" --msgbox "This Program Created By: Abdallah Hamdy\nGoodbye." 8 78
fi