-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbmx-whmapiaccess
64 lines (58 loc) · 1015 Bytes
/
bmx-whmapiaccess
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
#!/bin/bash
#bmxwhmapiaccess - 2019 - tony@bemba.mx
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit -1
fi
#Select command
if [ -z "$1" ]
then
echo "Please name a command to access"
exit -1
fi
case $1 in
"pass")
if [ ! -z "$2" ] && [ -z "$3" ]
then
echo "Password:"
read bmxpass
whmapi1 passwd user=$2 password=$bmxpass db_pass_update=1
exit -1
fi
if [ -z "$2" ] && [ -z "$3" ]
then
echo "Username:"
read bmxuser
echo "Password:"
read bmxpass
whmapi1 passwd user=$bmxuser password=$bmxpass db_pass_update=1
exit -1
fi
whmapi1 passwd user=$2 password=$3 db_pass_update=1
;;
"mail")
if [ -z "$2" ]
then
echo "Mail: No command selected"
exit -1
fi
case $2 in
"list")
if [ -z "$3" ]
then
echo "Mail:List: No user selected"
exit -1
fi
whmapi1 list_pops_for user=$3
exit -1
;;
*)
echo "Mail: No existing command selected"
;;
esac
;;
*)
whmapi1 "$@"
exit -1
;;
esac