mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-19 19:30:16 +00:00
Ensure debian and ubuntu get openvpn from the openvpn repo so they don't get an old server version
This commit is contained in:
parent
32f4674741
commit
3c0d0cb176
3 changed files with 19 additions and 7 deletions
|
@ -133,6 +133,8 @@ welcome any feedback on your experience. If you have problems using it, feel
|
||||||
free to post an issue here on github. I'll classify the issues the best I can
|
free to post an issue here on github. I'll classify the issues the best I can
|
||||||
to keep things sorted.
|
to keep things sorted.
|
||||||
|
|
||||||
|
You can also post on the [Google Space](https://goo.gl/spaces/kgp2Mcy5RDfZ5SSf8) I created for PiVPN, especially suited for general questions or discussions.
|
||||||
|
|
||||||
Contributions
|
Contributions
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@ function maybeOS_Support() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if lsb_release command is on their system
|
||||||
if hash lsb_release 2>/dev/null; then
|
if hash lsb_release 2>/dev/null; then
|
||||||
PLAT=$(lsb_release -si)
|
PLAT=$(lsb_release -si)
|
||||||
OSCN=$(lsb_release -sc) # We want this to be trusty xenial or jessie
|
OSCN=$(lsb_release -sc) # We want this to be trusty xenial or jessie
|
||||||
|
@ -87,13 +88,17 @@ if hash lsb_release 2>/dev/null; then
|
||||||
else
|
else
|
||||||
noOS_Support
|
noOS_Support
|
||||||
fi
|
fi
|
||||||
|
# else get info from os-release
|
||||||
elif [[ "$(cat /etc/os-release | grep raspbian)" ]]; then
|
elif [[ "$(cat /etc/os-release | grep raspbian)" ]]; then
|
||||||
if [[ "$(cat /etc/os-release | grep jessie)" ]]; then
|
if [[ "$(cat /etc/os-release | grep jessie)" ]]; then
|
||||||
PLAT="Raspbian"
|
PLAT="Raspbian"
|
||||||
OSCN="jessie"
|
OSCN="jessie"
|
||||||
else
|
else
|
||||||
|
PLAT="Ubuntu"
|
||||||
|
OSCN="unknown"
|
||||||
maybeOS_Support
|
maybeOS_Support
|
||||||
fi
|
fi
|
||||||
|
# else we prob don't want to install
|
||||||
else
|
else
|
||||||
noOS_Support
|
noOS_Support
|
||||||
fi
|
fi
|
||||||
|
@ -368,15 +373,19 @@ checkForDependencies() {
|
||||||
timestampAsDate=$(date -d @"$timestamp" "+%b %e")
|
timestampAsDate=$(date -d @"$timestamp" "+%b %e")
|
||||||
today=$(date "+%b %e")
|
today=$(date "+%b %e")
|
||||||
|
|
||||||
if [[ $PLAT == "Ubuntu" ]]; then
|
if [[ $PLAT == "Ubuntu" || $PLAT == "Debian" ]]; then
|
||||||
wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add -
|
if [[ $OSCN == "trusty" || $OSCN == "jessie" || $OSCN == "wheezy" ]]; then
|
||||||
echo "deb http://swupdate.openvpn.net/apt trusty main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null
|
wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add -
|
||||||
|
echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null
|
||||||
|
echo -n "::: Adding openvpn repo for $PLAT $OSCN ..."
|
||||||
|
$SUDO apt-get -qq update & spinner $!
|
||||||
|
echo " done!"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! "$today" == "$timestampAsDate" ] || [ $PLAT = "Ubuntu" ]; then
|
if [ ! "$today" == "$timestampAsDate" ]; then
|
||||||
#update package lists
|
#update package lists
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Either you are on ubuntu or"
|
|
||||||
echo -n "::: apt-get update has not been run today. Running now..."
|
echo -n "::: apt-get update has not been run today. Running now..."
|
||||||
$SUDO apt-get -qq update & spinner $!
|
$SUDO apt-get -qq update & spinner $!
|
||||||
echo " done!"
|
echo " done!"
|
||||||
|
@ -896,7 +905,8 @@ verifyFreeDiskSpace
|
||||||
# Find interfaces and let the user choose one
|
# Find interfaces and let the user choose one
|
||||||
chooseInterface
|
chooseInterface
|
||||||
|
|
||||||
if [[ $PLAT == "Ubuntu" ]]; then
|
# Only try to set static on Raspbian, otherwise let user do it
|
||||||
|
if [[ $PLAT != "Raspbian" ]]; then
|
||||||
avoidStaticIPv4Ubuntu
|
avoidStaticIPv4Ubuntu
|
||||||
else
|
else
|
||||||
getStaticIPv4Settings
|
getStaticIPv4Settings
|
||||||
|
|
|
@ -83,7 +83,7 @@ echo ":::"
|
||||||
$SUDO rm -rf /var/log/*openvpn* &> /dev/null
|
$SUDO rm -rf /var/log/*openvpn* &> /dev/null
|
||||||
if [[ $UINST_OVPN = 1 ]]; then
|
if [[ $UINST_OVPN = 1 ]]; then
|
||||||
$SUDO rm -rf /etc/openvpn &> /dev/null
|
$SUDO rm -rf /etc/openvpn &> /dev/null
|
||||||
if [[ $PLAT = "Ubuntu" ]]; then
|
if [[ $PLAT == "Ubuntu" || $PLAT == "Debian" ]]; then
|
||||||
printf "::: Removing openvpn apt source..."
|
printf "::: Removing openvpn apt source..."
|
||||||
$SUDO rm -rf /etc/apt/sources.list.d/swupdate.openvpn.net.list &> /dev/null
|
$SUDO rm -rf /etc/apt/sources.list.d/swupdate.openvpn.net.list &> /dev/null
|
||||||
$SUDO apt-get -qq update & spinner $!; printf "done!\n";
|
$SUDO apt-get -qq update & spinner $!; printf "done!\n";
|
||||||
|
|
Loading…
Reference in a new issue