pia.sh - simple PIA management client written in bash

edited November 4 in Linux VPN Setup Posts: 16
Hi all,
    Just a heads up if anyone needs a management script for openvpn on Arch or Debian:
Source

Any feedback or suggestions welcome!
   Cheers
Post edited by d4rkcat on

Comments

  • @d4rkcat I haven't tested this (nor an Arch user) but thank you for this! Hope others can find it useful.
  • edited November 4 Posts: 1
    arch user running your script. works like a charm, thanks much.

    feedback:
    consider adding a start at boot switch (maybe by setting a crontab).

    ┈┈┈┈┈┈▕▔╲
    ┈┈┈┈┈┈┈▏▕
    ┈┈┈┈┈┈┈▏▕▂▂▂
    ▂▂▂▂▂▂╱┈▕▂▂▂▏
    ▉▉▉▉▉┈┈┈▕▂▂▂▏
    ▉▉▉▉▉┈┈┈▕▂▂▂▏
    ▔▔▔▔▔▔╲▂▕▂▂▂▏
    Post edited by ratJuice on
  • Posts: 259
    i think that's a nice bit of work: the script.  the README example shows a number to select a server but it looks to me you're meant to select a server by name, yes?

    the quoting on the echo to create the resolv.conf contents looks mad complicated. have you encountered the use of inline input redirection (aka "here" input) ?

    echo begin!

    cat << _Unique_Text_Symbol_ > output-file-name
    text line 1
    text line 2
    and so on
    last text line
    _Unique_Text_Symbol_

    echo done!

  • edited November 9 Posts: 16
    @sn0wmonster
    Cheers bud, script should work on any linux distro with a bash shell, and also works automatically (installing dependencies) on debian and arch based distros (ubuntu, kali, mint, antergos etc etc). For any other linux just install openvpn and ufw and it will work.

    @ratJuice
    Thanks for trying it out, pushed a few updates since you posted so you might want to git pull and run with a -u to make sure you are compatible with the new version. I don't plan to implement any startup methods as the script is designed to be run in a terminal so you can shut down the VPN and restore all settings whenever you like and also see all the relevant information such as forwarded port.

    @martouf
    Thanks for taking a look at the script. The -s switch is meant to be run with a number, just like in the example. It is much quicker than typing in the full name of the location. You can see the numbers with the corresponding full place names by running with -l switch. About the echo for the resolv.conf, it isn't complicated at all it is called triple quoting and it is how i prefer to echo multi line strings. Whichever way works for you is cool, that's whats so great about bash, many ways to skin a cat:

    echo '''look
    at
    my
    lines'''
    echo -e "look\nat\nmy\nlines" echo bG9vawphdApteQpsaW5lcwo= | base64 -d
    Post edited by d4rkcat on
  • Posts: 16
    Have just completed the client in that it has all of the same features as the official one, with the added advantage of working on any linux with a bash shell, openvpn and ufw installed.
    Completely open source and only 363 lines of easy to understand bash code.
    Enjoy!
Sign In or Register to comment.