This repository has been archived by the owner on Jun 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debian: Remove config files when user uninstalls app
- Loading branch information
1 parent
62e8dfe
commit a1d5a35
Showing
2 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script runs when user install the debian package | ||
|
||
# Install apt repository source list if it does not exist | ||
if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep zulip; then | ||
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv 69AD12704E71A4803DCA3A682424BE5AE9BD10D9 | ||
echo "deb https://dl.bintray.com/zulip/debian/ stable main" | \ | ||
sudo tee -a /etc/apt/sources.list.d/zulip.list | ||
if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep zulip.list; then | ||
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv 69AD12704E71A4803DCA3A682424BE5AE9BD10D9 | ||
echo "deb https://dl.bintray.com/zulip/debian/ stable main" | \ | ||
sudo tee -a /etc/apt/sources.list.d/zulip.list; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
sudo apt-key del 69AD12704E71A4803DCA3A682424BE5AE9BD10D9 | ||
sudo rm /etc/apt/sources.list.d/zulip.list | ||
# This script runs when user uninstall the debian package. | ||
# It will remove all the config files and anything which was added by the app. | ||
|
||
# Remove apt repository source list when user uninstalls Zulip app | ||
if grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep zulip.list; then | ||
sudo apt-key del 69AD12704E71A4803DCA3A682424BE5AE9BD10D9; | ||
sudo rm /etc/apt/sources.list.d/zulip.list; | ||
fi | ||
|
||
# Get the root user | ||
if [ $SUDO_USER ]; | ||
then getSudoUser=$SUDO_USER; | ||
else getSudoUser=`whoami`; | ||
fi | ||
|
||
# Get the path for Zulip's desktop entry which is created by auto-launch script | ||
getDesktopEntry=/home/$getSudoUser/.config/autostart/zulip.desktop; | ||
|
||
# Remove desktop entry if exists | ||
if [ -f $getDesktopEntry ]; then | ||
sudo rm $getDesktopEntry; | ||
fi |