1
0
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:
Faicker Mo 2019-05-15 13:33:29 +08:00
parent e1e1b4ef91
commit e3bcd9bcc2

View File

@ -162,12 +162,17 @@ init_server() {
wg-quick up $interface wg-quick up $interface
} }
list_user() {
cat ${SAVED_FILE}
}
usage() { usage() {
echo "usage: $0 [-a|-d|-c|-g|-i] [username] echo "usage: $0 [-a|-d|-c|-g|-i] [username]
-i: init server conf -i: init server conf
-a: add user -a: add user
-d: del user -d: del user
-l: list all users
-c: clear all -c: clear all
-g: generate ip file -g: generate ip file
" "
@ -186,6 +191,8 @@ if [[ $action == "-i" ]]; then
init_server init_server
elif [[ $action == "-c" ]]; then elif [[ $action == "-c" ]]; then
clear_all clear_all
elif [[ $action == "-l" ]]; then
list_user
elif [[ $action == "-g" ]]; then elif [[ $action == "-g" ]]; then
generate_cidr_ip_file_if generate_cidr_ip_file_if
elif [[ ! -z "$user" && ( $action == "-a" || $action == "-d" ) ]]; then elif [[ ! -z "$user" && ( $action == "-a" || $action == "-d" ) ]]; then