Files
nordvpn-bin/nordvpn-bin.install
2024-10-03 12:01:05 -03:00

53 lines
1.5 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/$(echo $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/$(echo $lib | cut -d '/' -f 5)") = "$lib" ] ; then
ln -sf $lib /usr/lib/
fi
if [ ! -f /usr/lib/$(echo $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
}
pre_upgrade() {
chattr -i /var/lib/nordvpn/data/*
}
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/$(echo $lib | cut -d '/' -f 5)") = "$lib" ] ; then
unlink /usr/lib/$(echo $lib | cut -d '/' -f 5)
fi
fi
done
}