simplify list
This commit is contained in:
17
diyvpnctl.sh
17
diyvpnctl.sh
@@ -47,15 +47,14 @@ add() {
|
||||
}
|
||||
|
||||
list() {
|
||||
echo "config path: $diyvpn_cfg"
|
||||
paste <(
|
||||
echo "servers"
|
||||
cd "$diyvpn_cfg"
|
||||
basename ./*
|
||||
) <(
|
||||
echo "ListenAddress"
|
||||
sed -n '/LISTEN/s/.*=\(.*\)/\1/p' "$diyvpn_cfg"/*/config.rc
|
||||
) | column -t
|
||||
printf "config path: %s\n\n" "$diyvpn_cfg"
|
||||
cd "$diyvpn_cfg"
|
||||
|
||||
printf "%-20s %s\n" "Server" "ListenAddress"
|
||||
for s in *; do
|
||||
printf "%-20s %s\n" "$s" "$(sed -n '/LISTEN/s/.*=\(.*\)/\1/p' "$s"/config.rc)"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
action="${1:-none}"
|
||||
|
||||
Reference in New Issue
Block a user