Files
nordvpn-bin/nordvpn-bin.install
2025-05-02 14:27:18 -03:00

75 lines
2.7 KiB
Plaintext

post_install() {
echo ':: In order to enable nordvpn you have to start the following service:'
echo ' sudo systemctl enable --now nordvpnd'
echo ':: You have to add yourself to the nordvpn group:'
echo " sudo gpasswd -a USERNAME nordvpn"
echo ':: You then have to restart for the group to be created:'
echo " reboot"
# Add logic to avoid interposing with sqlite library if it already exists
for lib in /usr/lib/nordvpn/*.so ; do
if [[ -f $lib ]] ; then
if [[ ! -f "/usr/lib/$(printf '%s' $lib | cut -d '/' -f 5)" ]] ; then
ln -s $lib /usr/lib/
fi
fi
done
}
post_upgrade() {
# Add logic to avoid interposing with sqlite library if it already exists
for lib in /usr/lib/nordvpn/*.so ; do
if [[ -f $lib ]] ; then
if [[ $(readlink -- /usr/lib/$(printf '%s' $lib | cut -d '/' -f 5)) == $lib ]] ; then
unlink /usr/lib/$(printf '%s' $lib | cut -d '/' -f 5)
fi
if [[ ! -f "/usr/lib/$(printf '%s' $lib | cut -d '/' -f 5)" ]] ; then
ln -s $lib /usr/lib/
fi
fi
done
}
pre_install() {
if [ -d /var/lib/nordvpn/data/ ] ; then
chattr -i /var/lib/nordvpn/data/*
fi
## Remove symbolic link from latest patch
if [[ $(readlink -- /usr/lib/libxml2.so.2) == /usr/lib/nordvpn/libxml2.so.2 ]] ; then
unlink /usr/lib/libxml2.so.2
fi
echo "::: README"
echo "::: Before use, install libxml2-legacy from extra repository."
echo "::: It is flagged as optional, but it will be mandatory in next release,"
echo "::: in case NordVPN had not built against the new libxml2 just yet."
echo "::: 3.20.2-3 was made to remove the symbolic link from previous patch"
}
pre_upgrade() {
chattr -i /var/lib/nordvpn/data/*
## Remove symbolic link from latest patch
if [[ $(readlink -- /usr/lib/libxml2.so.2) == /usr/lib/nordvpn/libxml2.so.2 ]] ; then
unlink /usr/lib/libxml2.so.2
fi
echo "::: README"
echo "::: Before use, install libxml2-legacy from extra repository."
echo "::: It is flagged as optional, but it will be mandatory in next release,"
echo "::: in case NordVPN had not built against the new libxml2 just yet."
echo "::: 3.20.2-3 was made to remove the symbolic link from previous patch"
}
pre_remove() {
chattr -i /var/lib/nordvpn/data/*
# Add logic to avoid interposing with sqlite library if it already exists
for lib in /usr/lib/nordvpn/*.so ; do
if [[ -f $lib ]] ; then
if [[ $(readlink -- /usr/lib/$(printf '%s' $lib | cut -d '/' -f 5)) == $lib ]] ; then
unlink /usr/lib/$(printf '%s' $lib | cut -d '/' -f 5)
fi
fi
done
## Remove symbolic link from latest patch
if [[ $(readlink -- /usr/lib/libxml2.so.2) == /usr/lib/nordvpn/libxml2.so.2 ]] ; then
unlink /usr/lib/libxml2.so.2
fi
}