ExpressVPN Launcher

See also

Installing expressvpn

Download deb file and install

$ sudo dpkg -i expressvpn.deb

Enable your account with your auth token

$ expressvpn activate <token>

Test your connection

$ expressvpn connect

Installing launcher

Note

At start expressvpn overwrite /etc/resolv.conf.
We need to overwrite this overwrite.
smile

Creating sudoers

Create sudoers permission file /etc/sudeors.d/expressvpn_launch

<user>  ALL = NOPASSWD: /bin/cp /etc/resolv.conf.temp /etc/resolv.conf

Installing script

Create launcher script /usr/local/bin/launch_expressvpn.sh

#!/bin/bash

set -u

typeset -r WHICH="/usr/bin/which"
typeset -r CP=$(${WHICH} cp)
typeset -r EXPRESSVPN=$(${WHICH} expressvpn)
typeset -r SUDO=$(${WHICH} sudo)
typeset -r RESOLV_TEMP="/etc/resolv.conf.temp"
typeset -r RESOLV_FILE="/etc/resolv.conf"

${SUDO} ${CP} ${RESOLV_FILE} ${RESOLV_TEMP}
${EXPRESSVPN} connect
${SUDO} ${CP} ${RESOLV_TEMP} ${RESOLV_FILE}

# EOF

Creating Gnome file

Create desktop file /home/$USER/.local/share/applications/Start_expressVPN.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=[NOC] ExpressVPN Start
GenericName=[NOC] ExpressVPN Start
Comment=[NOC] ExpressVPN Start
Exec=/usr/local/bin/launch_expressvpn.sh
Icon=/usr/share/pixmaps/debian-security.png
StartupNotify=true
Terminal=false
Categories=GNOME;GTK;Others;

Create desktop file /home/$USER/.local/share/applications/Stop_expressVPN.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=[NOC] ExpressVPN Stop
GenericName=[NOC] ExpressVPN Stop
Comment=[NOC] ExpressVPN Stop
Exec=/usr/bin/expressvpn disconnect
Icon=/usr/share/pixmaps/debian-security.png
StartupNotify=true
Terminal=false
Categories=GNOME;GTK;Others;