docker-wireguard-pia icon indicating copy to clipboard operation
docker-wireguard-pia copied to clipboard

scripts/run: line 180: [: -eq: unary operator expected

Open zilexa opened this issue 3 years ago • 3 comments

Not sure what this means, but I cannot access qbittorrent. I have it running with similar compose on a different system. But for some reason, with the same compose, I keep getting this issue:


Sat Jun  5 17:47:48 UTC 2021: WireGuard successfully started


Sat Jun  5 17:47:48 UTC 2021: Allowing network access to 172.20.0.2/16 on eth0


Sat Jun  5 17:47:48 UTC 2021: Firewall enabled: Blocking non-WireGuard traffic


Sat Jun  5 17:47:48 UTC 2021: Allowing network access to 192.168.1.0/24


Sat Jun  5 17:47:48 UTC 2021: Adding route to 192.168.1.0/24


Sat Jun  5 17:47:48 UTC 2021: Starting port forward script


/scripts/run: line 180: [: -eq: unary operator expected


Sat Jun  5 17:47:48 UTC 2021: Verifying API requests. CN: frankfurt410


Sat Jun  5 17:47:48 UTC 2021: Getting PF token


Sat Jun  5 17:47:49 UTC 2021: Obtained PF token. Expires at 2021-08-07T05:47:35.869962964Z


Sat Jun  5 17:47:49 UTC 2021: Server accepted PF bind


Sat Jun  5 17:47:49 UTC 2021: Forwarding on port 28424


Sat Jun  5 17:47:49 UTC 2021: Running /scripts/pf_success.sh


Sat Jun  5 17:47:49 UTC 2021: Allowing incoming traffic on port 28424


Sat Jun  5 17:47:49 UTC 2021: Rebind interval: 900 seconds


Sat Jun  5 17:47:49 UTC 2021: Port dumped to /pia-shared/port.dat


Sat Jun  5 17:47:49 UTC 2021: This script should remain running to keep the forwarded port alive


Sat Jun  5 17:47:49 UTC 2021: Press Ctrl+C to exit

zilexa avatar Jun 05 '21 17:06 zilexa

https://github.com/thrnz/docker-wireguard-pia/blob/1a5d1410f792435c27a9c9ec63fab94dc063d24a/run#L180

I imagine you'd get that error if PORT_PERSIST is set to something unexpected. The Dockerfile sets it to 0 by default, and the script expects it to be either 0 or 1. I don't suppose you have it set to something non-numeric, or maybe an empty environment var? That could explain the error msg.

thrnz avatar Jun 06 '21 07:06 thrnz

Strange, this is my compose, the only env vars are the PIA username and password:

  vpn-proxy:
    container_name: vpn-proxy
    image: thrnz/docker-wireguard-pia
    restart: always
    networks: 
      - vpn-proxy
    cap_add:
      - NET_ADMIN
    privileged: 'true'
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
      - net.ipv6.conf.default.disable_ipv6=1
      - net.ipv6.conf.all.disable_ipv6=1
      - net.ipv6.conf.lo.disable_ipv6=1
    healthcheck:
      test: ping -c 1 www.google.com || exit 1
      interval: 30s
      timeout: 10s
      retries: 3
    environment:
      LOCAL_NETWORK: 192.168.1.0/24,10.6.0.1/24
      LOC: de-frankfurt
      USER: $VPN_USER_PIA
      PASS: $VPN_PW_PIA
      PORT_FORWARDING: 1
      PORT_PERSIST: 
    volumes:
      - $DOCKERDIR/vpn/pia:/pia
      - $DOCKERDIR/vpn/pia-shared:/pia-shared
    ports:
      - 9090:8080 #Qbittorrent webUI

zilexa avatar Jun 07 '21 08:06 zilexa

That compose file will be setting PORT_PERSIST to an empty value. The script expects it to be a number, so is throwing an error when it encounters it. I haven't added anything to catch stuff like that, though it might be worthwhile doing so to stop it from potentially misbehaving.

thrnz avatar Jun 08 '21 03:06 thrnz