opensnitch/ui/debian/postinst
Gustavo Iñiguez Goia 0f171f87d4 UI deb package improvements
* Purge files when using apt remove --purge
* Display a message to uninstall installed pkgs from pypi when invoking
apt remove
* link autostart .desktop file to /usr/share/applications instead of
copying it
2020-02-22 17:22:28 +01:00

47 lines
1.2 KiB
Bash
Executable file

#!/bin/sh
set -e
install_pip_pkgs()
{
DIALOG=$(which whiptail || which dialog)
$DIALOG --yesno "OpenSnitch GUI needs to install 3 more packages:
unicode_slugify, grpcio-tools and protobuf.
Note: It's better to install them as regular user instead of root:
pip3 install --user unicode_slugify protobuf grpcio-tools
Do you want to install them now?" 15 70 ||
if [ $? -eq 0 ]; then
echo "Installing grpcio-tools..."
pip3 install grpcio-tools || echo "Unable to install grpcio, try it manually."
echo
echo "Installing protobuf..."
pip3 install protobuf || echo "Unable to install protobuf, try it manually."
echo
echo "Installing slugify..."
pip3 install unicode_slugify || echo "Unable to install unicode_slugify, try it manually."
fi
exit 0
}
for i in $(ls /home)
do
path=/home/$i/.config/autostart/
if [ ! -d $path ]; then
mkdir -p $path
fi
if [ -f /usr/share/applications/opensnitch_ui.desktop ];then
ln -s /usr/share/applications/opensnitch_ui.desktop $path || true
fi
done
set +e
case "$1" in
configure)
install_pip_pkgs
;;
esac