mirror of
https://github.com/pivpn/pivpn.git
synced 2025-05-07 16:34:10 +02:00
refactor(scripts): Structure code as per codestyle
Fix #1636 Refactor code according to code style Constants, Functions, Script
This commit is contained in:
parent
79f7caf4d3
commit
71f7ca9b3b
20 changed files with 377 additions and 342 deletions
|
@ -3,11 +3,6 @@
|
|||
|
||||
STATUS_LOG="/var/log/openvpn-status.log"
|
||||
|
||||
if [[ ! -f "${STATUS_LOG}" ]]; then
|
||||
err "The file: ${STATUS_LOG} was not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
err() {
|
||||
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2
|
||||
}
|
||||
|
@ -72,6 +67,11 @@ listClients() {
|
|||
} | column -t -s $'\t'
|
||||
}
|
||||
|
||||
if [[ ! -f "${STATUS_LOG}" ]]; then
|
||||
err "The file: ${STATUS_LOG} was not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$#" -eq 0 ]]; then
|
||||
HR=1
|
||||
listClients
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue