From e3bcd9bcc26af2c577f2e5e198ae803dbdac9d5d Mon Sep 17 00:00:00 2001 From: Faicker Mo Date: Wed, 15 May 2019 13:33:29 +0800 Subject: [PATCH] add list user --- user.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/user.sh b/user.sh index e2dbb5d..31c2c5d 100755 --- a/user.sh +++ b/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