# If you ever want to uninstall OpenVPN, skip down to the bottom
# Get it
cd
test -f installed/openvpn-2.4.0.tar.xz &&
mv -f installed/openvpn-2.4.0.tar.xz .
test ! -f openvpn-2.4.0.tar.xz &&
wget --no-check-certificate \
https://swupdate.openvpn.org/community/releases/openvpn-2.4.0.tar.xz
# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "704658db39e95ae8d63bb7847e9eb7f638e76631 openvpn-2.4.0.tar.xz" | \
sha1sum -c
# Backup your /etc/openvpn directory and it's contents
test -d /etc/openvpn &&
( mkdir -p -m 0700 ~/backup
cd /etc/openvpn
tar cJvf ~/backup/openvpn-$(date +%Y%m%d).tar.xz .
chmod 600 ~/backup/openvpn-$(date +%Y%m%d).tar.xz )
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg openvpn
# Remove documentation from old versions
find /usr/doc -maxdepth 1 -type d -name "openvpn-*" -exec rm -r {} \;
# Install it, strip binaries
make install-strip
# If you are going to have it start with --writepid (or you can put that in
# the configuration file) and put the pid in a file in directory
# /var/run/openvpn, make sure it exists and is writable by whatever
# user and/or group you have set in the configuration. If you have
# "user nobody" and "group nobody" set, this should do it:
mkdir -p /var/run/openvpn
chown root:nobody /var/run/openvpn
chmod 770 /var/run/openvpn
# For more info about OpenVPN configuration see:
# less ./README
# man openvpn
# sample/sample-config-files/ (under the source)
# HOWTO, Examples, Manuals, Wiki, etc. at https://openvpn.net/index.php/open-source.html
# I have a needlessly overcomplicated :-) sample /etc/rc.d/rc.openvpn-server
# startup script here. To get it to run on boot-up, add something to start
# it to /etc/rc.d/rc.local
cd /etc/rc.d
test -f rc.openvpn-server &&
( mv -f rc.openvpn-server rc.openvpn-server.old
chmod 600 rc.openvpn-server.old )
wget -nc http://englanders.us/pub/linux/misc/rc.openvpn-server
test -s rc.openvpn-server && chmod 700 rc.openvpn-server