mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
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
This commit is contained in:
parent
e3b0287e2e
commit
0f171f87d4
3 changed files with 66 additions and 29 deletions
|
@ -2,6 +2,30 @@
|
|||
|
||||
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/
|
||||
|
@ -9,23 +33,15 @@ do
|
|||
mkdir -p $path
|
||||
fi
|
||||
if [ -f /usr/share/applications/opensnitch_ui.desktop ];then
|
||||
cp /usr/share/applications/opensnitch_ui.desktop $path
|
||||
ln -s /usr/share/applications/opensnitch_ui.desktop $path || true
|
||||
fi
|
||||
done
|
||||
|
||||
set +e
|
||||
|
||||
DIALOG=$(which whiptail || which dialog)
|
||||
case "$1" in
|
||||
configure)
|
||||
install_pip_pkgs
|
||||
;;
|
||||
esac
|
||||
|
||||
$DIALOG --yesno "OpenSnitch GUI needs to install 3 more packages from
|
||||
pypi using pip3: unicode_slugify, grpcio-tools and protobuf.\n\nDo you want to install them
|
||||
now?" 15 60
|
||||
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
|
||||
|
|
23
ui/debian/postrm
Executable file
23
ui/debian/postrm
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
purge_files()
|
||||
{
|
||||
for i in $(ls /home)
|
||||
do
|
||||
path=/home/$i/.config/
|
||||
if [ -h $path/autostart/opensnitch_ui.desktop -o -f $path/autostart/opensnitch_ui.desktop ];then
|
||||
rm -f $path/autostart/opensnitch_ui.desktop
|
||||
fi
|
||||
if [ -d $path/opensnitch/ ]; then
|
||||
rm -rf $path/opensnitch/
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
purge)
|
||||
purge_files
|
||||
;;
|
||||
esac
|
|
@ -2,18 +2,16 @@
|
|||
|
||||
set -e
|
||||
|
||||
for i in $(ls /home)
|
||||
do
|
||||
path=/home/$i/.config/autostart/opensnitch_ui.desktop
|
||||
if [ -f $path ];then
|
||||
rm -f $path
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
echo " If you don't need them anymore, remember to uninstall unicode_slugify, grcpio-tools and protobuf:"
|
||||
echo
|
||||
echo " pip3 uninstall unicode_slugify"
|
||||
echo " pip3 uninstall grcpio-tools"
|
||||
echo " pip3 uninstall protobuf"
|
||||
echo
|
||||
case "$1" in
|
||||
remove)
|
||||
echo
|
||||
echo " If you don't need them anymore, remember to uninstall unicode_slugify, grcpio-tools and protobuf:"
|
||||
echo
|
||||
echo " pip3 uninstall unicode_slugify"
|
||||
echo " pip3 uninstall grcpio-tools"
|
||||
echo " pip3 uninstall protobuf"
|
||||
echo
|
||||
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Reference in a new issue