mirror of
https://github.com/faicker/wg-config.git
synced 2020-11-18 19:53:49 -08:00
add list user
This commit is contained in:
parent
e1e1b4ef91
commit
e3bcd9bcc2
7
user.sh
7
user.sh
@ -162,12 +162,17 @@ init_server() {
|
||||
wg-quick up $interface
|
||||
}
|
||||
|
||||
list_user() {
|
||||
cat ${SAVED_FILE}
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 [-a|-d|-c|-g|-i] [username]
|
||||
|
||||
-i: init server conf
|
||||
-a: add user
|
||||
-d: del user
|
||||
-l: list all users
|
||||
-c: clear all
|
||||
-g: generate ip file
|
||||
"
|
||||
@ -186,6 +191,8 @@ if [[ $action == "-i" ]]; then
|
||||
init_server
|
||||
elif [[ $action == "-c" ]]; then
|
||||
clear_all
|
||||
elif [[ $action == "-l" ]]; then
|
||||
list_user
|
||||
elif [[ $action == "-g" ]]; then
|
||||
generate_cidr_ip_file_if
|
||||
elif [[ ! -z "$user" && ( $action == "-a" || $action == "-d" ) ]]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user