summaryrefslogtreecommitdiffstats
path: root/network/nordvpn
diff options
context:
space:
mode:
Diffstat (limited to 'network/nordvpn')
-rw-r--r--network/nordvpn/README17
-rw-r--r--network/nordvpn/doinst.sh6
-rw-r--r--network/nordvpn/nordvpn.SlackBuild73
-rw-r--r--network/nordvpn/nordvpn.info10
-rw-r--r--network/nordvpn/rc.nordvpn61
5 files changed, 117 insertions, 50 deletions
diff --git a/network/nordvpn/README b/network/nordvpn/README
index 298c79fd38..b4f3ba5626 100644
--- a/network/nordvpn/README
+++ b/network/nordvpn/README
@@ -1,9 +1,16 @@
-The NordVPN app for Linux protects your sensitive data with military-grade
-encryption, so that whatever you do online stays secure and private.
+The NordVPN app for Linux protects your sensitive data with
+military-grade encryption, so that whatever you do online stays secure
+and private.
More than 5000 servers worldwide. No logs of your online activity.
Secure up to 6 devices with a single account.
Access online content securely, with no restrictions.
+This script requires a 'nordvpn' group to exist before running.
+You can create this group like this (Run these as root):
+ groupadd -g 373 nordvpn
+ usermod -aG nordvpn $USER (Replace $USER with your username)
+Then log out of the system and login again.
+
The following can be used to start/stop NordVPN automatically:
/etc/rc.d/rc.local
if [ -x /etc/rc.d/rc.nordvpn ]; then
@@ -15,9 +22,9 @@ The following can be used to start/stop NordVPN automatically:
/etc/rc.d/rc.nordvpn stop
fi
-NOTE: NordVPN has implemented NordLynx (WireGuard protocol) into the app.
-It is still under heavy development. However if you want to try it, you need to install
-these 2 optional dependencies:
+NOTE: NordVPN has implemented NordLynx (WireGuard protocol) into the
+app. Dependencies already satisfied at full install.
+In case of any issue, you need to reinstall following packages:
wireguard-linux-compat
wireguard-tools
diff --git a/network/nordvpn/doinst.sh b/network/nordvpn/doinst.sh
index 3f2e7491ca..51d3c3bd15 100644
--- a/network/nordvpn/doinst.sh
+++ b/network/nordvpn/doinst.sh
@@ -1,3 +1,7 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
if [ -x /usr/bin/update-mime-database ]; then
/usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi
@@ -9,5 +13,5 @@ if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
fi
if [ -x /etc/rc.d/rc.nordvpn ]; then
- /etc/rc.d/rc.nordvpn restart
+ /etc/rc.d/rc.nordvpn restart > /dev/null
fi
diff --git a/network/nordvpn/nordvpn.SlackBuild b/network/nordvpn/nordvpn.SlackBuild
index 719ad53827..742c2b86c7 100644
--- a/network/nordvpn/nordvpn.SlackBuild
+++ b/network/nordvpn/nordvpn.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
#
-# Slackware build script for nordvpn.
+# Slackware build script for NordVPN
#
-# Copyright 2019 Reza Talebi, Shahin Shahr, Iran.
+# Copyright 2019-2021 Reza Talebi, Shahin Shahr, Iran.
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,10 +22,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Modified by Pouria Rezaei <Pouria.rz@outlook.com>
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=nordvpn
-VERSION=${VERSION:-3.6.1}
+VERSION=${VERSION:-3.17.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+# Select nordvpn's default group
+NORD_GROUP=${NORD_GROUP:-nordvpn}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,45 +43,66 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-SRCNAM=$PRGNAM-stable
-
set -e
-if [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
- BITS="amd64"
+if [ "$ARCH" = "i586" ]; then
+ DEBARCH="i386"
+elif [ "$ARCH" = "i686" ]; then
+ DEBARCH="i386"
+elif [ "$ARCH" = "x86_64" ]; then
+ DEBARCH="amd64"
else
- echo "Package for $(uname -m) architecture is not available."
+ echo "Package for $ARCH architecture is not available."
exit 1
fi
+bailout() {
+ echo " You must have a $NORD_GROUP group to run this script. "
+ echo " Something like this should suffice for most systems (Run as root): "
+ echo " # groupadd -g 373 $NORD_GROUP "
+ echo " # usermod -aG $NORD_GROUP \$USER (Replace \$USER with your username)"
+ echo " Then log out of the system and login again."
+ exit 1
+}
+
+# Bail if group isn't valid on your system.
+if ! grep -q "^$NORD_GROUP:" /etc/group; then
+ bailout
+fi
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-${VERSION}
-mkdir -p $PRGNAM-${VERSION}
+rm -rf $PRGNAM-$VERSION
+mkdir -p $PRGNAM-$VERSION
+
cd $PKG
-rpm2cpio $CWD/$PRGNAM-${VERSION}-${BUILD}.${ARCH}.rpm | cpio -idmv
-rm -rf etc
-rm -rf usr/lib
+ar p $CWD/${PRGNAM}_${VERSION}_${DEBARCH}.deb data.tar.gz | tar zxv
+
+rm -fR etc usr/lib
-mv $PKG/usr/share/man $PKG/usr/
+# Move man where the man likes
+mv usr/share/man usr/
+rm -rf $PKG/usr/share/doc
-mkdir -p usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
-mkdir -p $PKG/etc/rc.d/
-cp $CWD/rc.nordvpn $PKG/etc/rc.d/rc.nordvpn
+mkdir -p $PKG/etc/rc.d
+install -m 0755 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM
cd $PKG
-/sbin/makepkg -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -p -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/network/nordvpn/nordvpn.info b/network/nordvpn/nordvpn.info
index 5edda7c612..4b04fd56b2 100644
--- a/network/nordvpn/nordvpn.info
+++ b/network/nordvpn/nordvpn.info
@@ -1,10 +1,10 @@
PRGNAM="nordvpn"
-VERSION="3.6.1"
+VERSION="3.17.2"
HOMEPAGE="https://www.nordvpn.com/"
-DOWNLOAD="UNSUPPORTED"
-MD5SUM=""
-DOWNLOAD_x86_64="https://repo.nordvpn.com/yum/nordvpn/centos/x86_64/Packages/n/nordvpn-3.6.1-1.x86_64.rpm"
-MD5SUM_x86_64="9436104aa4bdf4f0d43e736da372fd83"
+DOWNLOAD="https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn_3.17.2_i386.deb"
+MD5SUM="cfa324fa4b8280710f00e5c4634711cb"
+DOWNLOAD_x86_64="https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn_3.17.2_amd64.deb"
+MD5SUM_x86_64="9fe543322dd827857a9de14241b1b38f"
REQUIRES=""
MAINTAINER="Reza Talebi"
EMAIL="reza.talebi.73@outlook.com"
diff --git a/network/nordvpn/rc.nordvpn b/network/nordvpn/rc.nordvpn
index c59bb60073..bc1eb255a4 100644
--- a/network/nordvpn/rc.nordvpn
+++ b/network/nordvpn/rc.nordvpn
@@ -3,28 +3,58 @@
# Short-Description: Protect your privacy online and access media content with no regional restrictions. Strong encryption and no-log policy with 3000+ servers in 60+ countries.
### END INIT INFO
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
-PRGNAM=nordvpn
-PID=/var/run/$PRGNAM.pid
-DAEMON=/usr/sbin/${PRGNAM}d
-SOCK=/run/${PRGNAM}d.sock
+BASE=nordvpn
+DAEMON=/usr/sbin/${BASE}d
+PID=/var/run/$BASE.pid
+SOCK=/run/$BASE/${BASE}d.sock
+SOCKDIR=/run/$BASE
+create_socket_dir() {
+ if [[ -d $SOCKDIR ]]; then
+ return
+ fi
+ mkdir -m 0770 $SOCKDIR
+ chown root:$BASE $SOCKDIR
+}
+
+checkuser() {
+ status=0
+ for u in $(who | awk '{print $1}' | sort | uniq)
+ do
+ if [ "$u" == "$1" ]; then
+ return 0
+ fi
+ done
+ return 1
+}
#
# Function that starts the daemon
#
nordvpnd_start()
{
+ checkuser
+ create_socket_dir
rm -rf $SOCK
if [ -s $PID ]; then
- echo "$PRGNAM is already running: $(cat $PID)"
+ echo "$BASE is already running: $(cat $PID)"
exit 1
fi
if [ -x $DAEMON ]; then
- echo "Starting $PRGNAM"
- $DAEMON &
+ echo "Starting $BASE"
+ sleep 1
+ # $DAEMON start-stop-daemon --start --quiet -g "nordvpn" --pidfile $PID --exec $DAEMON
+ $DAEMON > /dev/null &
pidof $DAEMON > $PID
+ sleep 10
+ if [ -S "$SOCK" ]; then
+ echo "$BASE has been started."
+ else
+ echo "$BASE failed to start. Please restart the daemon."
+ fi
fi
}
@@ -34,11 +64,14 @@ nordvpnd_start()
nordvpnd_stop()
{
if [ -s $PID ]; then
+ echo "Stopping $BASE"
+ sleep 1
kill $(cat $PID)
rm -rf $PID $SOCK
- echo "$PRGNAM has been stopped."
+ sleep 1
+ echo "$BASE has been stopped."
else
- echo "$PRGNAM is not running."
+ echo "$BASE is not running."
fi
}
@@ -47,15 +80,9 @@ nordvpnd_stop()
#
nordvpnd_restart()
{
- echo "Stopping $PRGNAM"
- sleep 1
nordvpnd_stop
- echo "$PRGNAM has been stopped."
- sleep 1
- echo "Restarting $PRGNAM"
sleep 1
nordvpnd_start
- echo "$PRGNAM has been restarted."
}
#
@@ -64,9 +91,9 @@ nordvpnd_restart()
nordvpnd_status()
{
if [ -s $PID ]; then
- echo "$PRGNAM is running: $(cat $PID)"
+ echo "$BASE is running: $(cat $PID)"
else
- echo "$PRGNAM is not running."
+ echo "$BASE is not running."
fi
}