-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeluser.sh
More file actions
executable file
·76 lines (72 loc) · 1.23 KB
/
deluser.sh
File metadata and controls
executable file
·76 lines (72 loc) · 1.23 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
cd lib
pos=0
rows=2
if [ "$1" == "" ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]
then
echo "Usage: $(basename "$0") <username>"
exit 1
fi
function PrintMenu() {
clear
echo "==========================="
echo "what do you want to delete?"
echo "==========================="
echo "e=select w,s=change q=quit"
echo "==========================="
if [[ "$pos" == "0" ]]
then
echo "[x] web (+configs)"
echo "[ ] config"
echo "[ ] config (all)"
elif [[ "$pos" == "1" ]]
then
echo "[ ] web (+configs)"
echo "[x] config"
echo "[ ] config (all)"
elif [[ "$pos" == "2" ]]
then
echo "[ ] web (+configs)"
echo "[ ] config"
echo "[x] config (all)"
else
echo "error $pos out of scope"
fi
}
while true
do
PrintMenu
read -n 1 -p "" inp
echo ""
if [[ "$inp" == "w" ]]
then
if [[ "$pos" -gt "0" ]]
then
pos=$((pos - 1))
fi
elif [[ "$inp" == "s" ]]
then
if [[ "$pos" -lt "$rows" ]]
then
pos=$((pos + 1))
fi
elif [[ "$inp" == "e" ]]
then
if [[ "$pos" == "0" ]]
then
./deluser-web.sh $1
elif [[ "$pos" == "1" ]]
then
./deluser-vpn.sh $1
elif [[ "$pos" == "2" ]]
then
./deluser-all-vpn.sh
else
echo "error out of range"
fi
exit
elif [[ "$inp" == "q" ]]
then
exit
fi
done