Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ if [[ -z "$default_route_ip" ]]; then
exit 1
fi

configs=`find /etc/wireguard -type f -printf "%f\n"`
configs=$(find /etc/wireguard -type f -printf "%f\n")
if [[ -z "$configs" ]]; then
echo "No configuration file found in /etc/wireguard" >&2
exit 1
elif [[ $(echo "$configs" | wc -l) -gt 1 ]]; then
echo "Multiple configuration files found in /etc/wireguard, expected only one" >&2
exit 1
fi

config=`echo $configs | head -n 1`
interface="${config%.*}"
interface="${configs%.*}"

if [[ "$(cat /proc/sys/net/ipv4/conf/all/src_valid_mark)" != "1" ]]; then
echo "sysctl net.ipv4.conf.all.src_valid_mark=1 is not set" >&2
Expand Down
Loading