Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit d3ce629

Browse files
committed
Make insignificant changes
1 parent 333fcc6 commit d3ce629

File tree

4 files changed

+15
-31
lines changed

4 files changed

+15
-31
lines changed

build.py

-20
This file was deleted.

build/entry.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22

3-
set -e
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
46

57
cleanup() {
68
kill TERM "$openvpn_pid"
@@ -19,7 +21,7 @@ else
1921
fi
2022

2123
if [[ -z $config_file ]]; then
22-
>&2 echo 'no openvpn configuration file found'
24+
echo "no openvpn configuration file found" >&2
2325
exit 1
2426
fi
2527

build/killswitch.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22

3-
set -e
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
46

57
iptables --insert OUTPUT \
68
! --out-interface tun0 \
@@ -19,14 +21,14 @@ done
1921
# Punch holes in the firewall for the OpenVPN server addresses
2022
# $config is set by OpenVPN:
2123
# "Name of first --config file. Set on program initiation and reset on SIGHUP."
22-
global_port=$(awk '$1 == "port" { print $2 }' "${config:?}")
23-
global_protocol=$(awk '$1 == "proto" { print $2 }' "${config:?}")
24-
remotes=$(awk '$1 == "remote" { print $2, $3, $4 }' "${config:?}")
24+
global_port=$(awk '$1 == "port" { print $2 }' "${config:?"config file not found by kill switch"}")
25+
global_protocol=$(awk '$1 == "proto" { print $2 }' "${config:?"config file not found by kill switch"}")
26+
remotes=$(awk '$1 == "remote" { print $2, $3, $4 }' "${config:?"config file not found by kill switch"}")
2527
ip_regex='^(([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))\.){3}([1-9]?[0-9]|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))$'
2628
while IFS= read -r line; do
2729
# Read a comment-stripped version of the line
2830
# Fixes #84
29-
IFS=' ' read -ra remote <<< "${line%%\#*}"
31+
IFS=" " read -ra remote <<< "${line%%\#*}"
3032
address=${remote[0]}
3133
port=${remote[1]:-${global_port:-1194}}
3234
protocol=${remote[2]:-${global_protocol:-udp}}

docker-compose.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ services:
33
image: ghcr.io/wfg/openvpn-client:latest
44
container_name: openvpn-client
55
cap_add:
6-
- NET_ADMIN
6+
- NET_ADMIN
77
devices:
8-
- /dev/net/tun:/dev/net/tun
8+
- /dev/net/tun:/dev/net/tun
99
environment:
10-
- ALLOWED_SUBNETS=192.168.10.0/24
10+
- ALLOWED_SUBNETS=192.168.10.0/24
1111
volumes:
12-
- ./local:/config
12+
- ./local:/config
1313
restart: unless-stopped

0 commit comments

Comments
 (0)