Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions fs/etc/services.d/nordvpn/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/bash

legacy_supported=$(lsmod | grep ip_tables >/dev/null 2>&1 && echo yes || echo no)
nft_supported=$(lsmod | grep nf_tables >/dev/null 2>&1 && echo yes || echo no)
if [ x$IPTABLES = xlegacy ] ; then
if [ x$legacy_supported = xyes ] ; then
update-alternatives --set iptables /usr/sbin/iptables-legacy
else
update-alternatives --set iptables /usr/sbin/iptables-nft
fi
else
if [ x$nft_supported = xyes ] ; then
update-alternatives --set iptables /usr/sbin/iptables-nft
else
update-alternatives --set iptables /usr/sbin/iptables-legacy
fi
fi

if [[ ! -d /run/nordvpn ]]; then
mkdir -m 0770 /run/nordvpn
fi
Expand Down