unifios-utilities/wireguard-go/on_boot.d/20-wireguard.sh

15 lines
463 B
Bash
Raw Normal View History

2020-07-11 19:03:29 +00:00
#!/bin/sh
2020-07-13 07:03:06 +00:00
CONTAINER=wireguard
2020-07-13 05:54:09 +00:00
# Starts a wireguard container that is deleted after it is stopped.
# All configs stored in /mnt/data/wireguard
2020-07-13 07:03:06 +00:00
if podman container exists ${CONTAINER}; then
podman start ${CONTAINER}
else
podman run -i -d --rm --net=host --name ${CONTAINER} --privileged \
2020-07-13 05:54:09 +00:00
-v /mnt/data/wireguard:/etc/wireguard \
-v /dev/net/tun:/dev/net/tun \
-e LOG_LEVEL=info -e WG_COLOR_MODE=always \
2021-04-05 09:43:35 +00:00
masipcat/wireguard-go:latest-arm64v8
2020-07-13 07:03:06 +00:00
fi