V3.19.0 -- Fix library symbolic link (Patch)

This commit is contained in:
Mxzcabel
2024-10-03 11:42:22 -03:00
parent 37a3aad78a
commit e031941131

View File

@@ -5,11 +5,27 @@ post_install() {
echo " sudo gpasswd -a USERNAME nordvpn" echo " sudo gpasswd -a USERNAME nordvpn"
echo ':: You then have to restart for the group to be created:' echo ':: You then have to restart for the group to be created:'
echo " reboot" echo " reboot"
# Add logic to avoid interposing with sqlite library if it already exists
for lib in /usr/lib/nordvpn/*.so ; do for lib in /usr/lib/nordvpn/*.so ; do
if [ -f "$lib" ] ; then if [ -f "$lib" ] ; then
if [ ! -f /usr/lib/$(echo $lib | cut -d '/' -f 5) ] ; then
ln -s $lib /usr/lib/ ln -s $lib /usr/lib/
fi 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 done
} }
@@ -23,19 +39,14 @@ pre_upgrade() {
chattr -i /var/lib/nordvpn/data/* chattr -i /var/lib/nordvpn/data/*
} }
post_upgrade() {
for lib in /usr/lib/nordvpn/*.so ; do
if [ -f "$lib" ] ; then
ln -sf $lib /usr/lib/
fi
done
}
pre_remove() { pre_remove() {
chattr -i /var/lib/nordvpn/data/* 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 for lib in /usr/lib/nordvpn/*.so ; do
if [ -f "$lib" ] ; then 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) unlink /usr/lib/$(echo $lib | cut -d '/' -f 5)
fi fi
fi
done done
} }