|
|
|
@ -59,6 +59,9 @@ jobs: |
|
|
|
run: | |
|
|
|
for cmd in "docker" "podman" "sudo podman"; do |
|
|
|
$cmd run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf wireguard |
|
|
|
timeout 5 $cmd exec wireguard wg show || echo "Container not ready yet" |
|
|
|
$cmd logs wireguard |
|
|
|
if ! $cmd ps | grep -q wireguard; then echo "ERROR: WireGuard container exited" && exit 1; fi |
|
|
|
normal_ip=$($cmd run --rm curlimages/curl --max-time 3 --retry 3 --retry-delay 1 --retry-all-errors ifconfig.io) |
|
|
|
wireguard_ip=$($cmd run --rm --net=container:wireguard curlimages/curl --max-time 3 --retry 3 --retry-delay 1 --retry-all-errors ifconfig.io) |
|
|
|
if [ "$normal_ip" = "$wireguard_ip" ]; then echo "normal ip and wireguard ip are the same" && exit 1; fi |
|
|
|
|