Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to work with PIA next gen. Cleaned up dependencies (dig issue) #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

taylorcox75
Copy link

First, awesome project. I've been looking for something like it for a while. I initially updated the servers from legacy to next gen, and did some minor cleanup as I was trying to figure out why dig wasn't being installed (it's actually a subset of dnsutils). I don't really expect you too merge this pull request, I just figured if I made updates on my fork, might as well see if you're interested.

Next-Gen servers

PIA updated there server list to "next gen" and will be sunsetting legacy soon (some have already started) The new url extension is {server_region}.privacy.network. It still comes from that same URL, you just did a filter for text that comes from the "Legacy" tab of the url. It defaults to Next Gen in a browser
https://www.privateinternetaccess.com/pages/network/

Official sunset of legacy announcement
https://www.privateinternetaccess.com/blog/private-internet-access-legacy-vpn-network-sunset-announcement-30-september/

Startup/Dependency Cleanup

I didn't really mean to rewrite the startup and dependency install, I didn't have dig installed and found it can't be installed via apt install dig like the project does. It comes from dnsutils. Netselect also comes from the default Debian repository. So no need to wget the specific processor builds for the user, apt install has it covered!

I'm also super lazy. So I always forget to type sudo ./PIA
I added a small line of code that allows the user to hit yes or no on that message. No exits and yes runs the script as root (sudo). It will still prompt the user for their password and everything.

PIA
@@ -1,165 +1,19 @@
#!/bin/bash
#
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed commented out block of dead code

PIA
trap ctrl_c SIGHUP SIGINT SIGTERM
if [[ $EUID -ne 0 ]]; then
printf "%b\n" "This script requires root privileges for Netselect (Fastest Server Check),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Netselect now downloaded via apt install

PIA
esac
fi
printf "Script needs to be ran as root, restart with sudo? [y/n] "
read -n 1 elev
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If user says yes will run the rest of the script in 'sudo bash' (same as sudo ./PIA

PIA
@@ -168,56 +22,27 @@ CheckScriptDependencies ()
{

declare -a ARRAY
ARRAY=()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some unnecessary values (Dependencies is global so we can access it directly)

PIA
do
if ! command -v "$Package" > /dev/null 2>&1; then
if [[ $Package == 'dnsutils' ]] ; then
if command -v dig > /dev/null 2>&1; then continue; fi
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dnsutils can't be ran in bash. Always returns "no command". That's because it isn't a single package, it's a combination of a ton of them. The old way dig installation candidate would not be found. Simply changing the word dig to dnsutils in the array with the old logic would never be able to find command dnsutils And always want to install it. That's why the nested if statement says if it is the DNS package, then check if diggs there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant