-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGUI_SAMPLE.sh
More file actions
26 lines (18 loc) · 1.05 KB
/
GUI_SAMPLE.sh
File metadata and controls
26 lines (18 loc) · 1.05 KB
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
#!/bin/bash
count=0
# Create a custom Zenity dialog with specific width and height
login=$(zenity --info --width 400 --height 500 --text="\n\tThis is a Custom Zenity Dialog box to display Linux User Details. \n\tEnter Proceed to travel to the next page with User Login" --ok-label="Proceed"); echo $login
USR=$(zenity --entry --width 400 --height 200 --title "Username and password" --text "\n\tEnter username: " --ok-label="Proceed"); echo $USR
while [ count -lt 10 ]; do
password=$(zenity --entry --width 400 --height 200 --title "Password" --text "\n\tEnter password" --hide-text); #echo $password
if [ "$password" == "zed2408" ]; then
accept=$(zenity --info --width 350 --height 200 --title "Accepted" --text "\n\t Welcome user!!"); echo $accept
else
reject=$(zenity --info --width 350 --height 200 --title "Rejected" --text "\n\t Invalid Password! Try again..."); echo $reject
$((count++))
fi
done
if [ $count -eq 10 ]; then
fin=$(zenity --info --width 300 --height 200 --text "\n\t REJECTED"); echo $fin
break
fi