Compare commits

...

3 Commits
v1.0.5 ... main

Author SHA1 Message Date
b662d82ae3 🐛 use echo, lib log not loaded 2024-09-12 20:12:08 +02:00
bad40c1d1a 💄 use alert boxes for notes 2024-09-07 13:25:07 +02:00
bd099af12f 🥅 catch file disappearing right before reading 2024-09-02 21:53:44 +02:00
2 changed files with 7 additions and 4 deletions

View File

@ -25,7 +25,8 @@ services:
$ docker compose up -d $ docker compose up -d
``` ```
> ▶️ For both variants, persistent config and key files will be stored in the `./data` directory. Feel free to change this to your needs. > [!TIP]
> For both variants, persistent config and key files will be stored in the `./data` directory. Feel free to change this to your needs.
## Client Management ## Client Management
Generate new client keys and output its config: Generate new client keys and output its config:
@ -43,4 +44,5 @@ Revoke a client's keys:
$ docker compose exec main clientmgmt revoke $ docker compose exec main clientmgmt revoke
``` ```
> ▶️ If you are using docker run, replace `docker compose exec main` with `docker exec -it openvpn`. > [!NOTE]
> If you are using docker run, replace `docker compose exec main` with `docker exec -it openvpn`.

View File

@ -19,7 +19,7 @@ trap_exit(){
q=$(( q + 1 )) q=$(( q + 1 ))
snore 1 snore 1
if [[ "$q" -ge 15 ]]; then if [[ "$q" -ge 15 ]]; then
log_warn "Sending kill to OpenVPN" echo "Sending kill to OpenVPN" 1>&2
kill -s KILL -- $openvpn_pid 2> /dev/null || true kill -s KILL -- $openvpn_pid 2> /dev/null || true
break break
fi fi
@ -53,7 +53,8 @@ proc_running(){
# try reading state # try reading state
local state_path="/proc/$1/stat" local state_path="/proc/$1/stat"
[[ ! -f "$state_path" ]] && return 1 [[ ! -f "$state_path" ]] && return 1
local state=$(cat "$state_path" | cut -d ' ' -f3) local state
state=$(cat "$state_path" 2> /dev/null | cut -d ' ' -f3) || return 1
# parse state # parse state
case "$state" in case "$state" in