From cd11ae100e624f7c7041642d14239c68a42fdc22 Mon Sep 17 00:00:00 2001 From: fsantini Date: Fri, 21 Dec 2018 17:55:20 +0100 Subject: [PATCH] Support for uninstall --- .gitignore | 2 ++ README.md | 4 ++++ src/usr/local/kobocloud/get.sh | 7 +++++++ src/usr/local/kobocloud/udev_mount.sh | 2 ++ src/usr/local/kobocloud/uninstall.sh | 6 ++++++ 5 files changed, 21 insertions(+) create mode 100644 .gitignore create mode 100755 src/usr/local/kobocloud/uninstall.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fe26154 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +KoboRoot.tgz +kobocloudrc diff --git a/README.md b/README.md index aebd6ca..4c1c434 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ To add a Dropbox link, open your dropbox in a browser. Select the folder that yo ## Usage The new files will be downloaded when the kobo connects to the Internet for a sync. +## Uninstallation +To properly uninstall KoboCloud, edit the kobocloudrc file so that it contains the word `UNINSTALL` in a single line (all capital, no spaces before or after). Restart your Kobo. The next time the Kobo is connected to the Internet, the program will delete itself. +The directory .kobo/kobocloud will not be deleted: after connecting the ereader to a computer, you should move the files from the Library subfolder in order not to lose your content, and delete the whole kobocloud directory manually. + ## Troubleshooting KoboCloud keeps a log of each session in the .kobo/kobocloud/get.log file. If something goes wrong, useful information can be found there. Please send a copy of this file with every bug report. diff --git a/src/usr/local/kobocloud/get.sh b/src/usr/local/kobocloud/get.sh index 16f996e..51a2d16 100755 --- a/src/usr/local/kobocloud/get.sh +++ b/src/usr/local/kobocloud/get.sh @@ -4,6 +4,13 @@ #load config . `dirname $0`/config.sh +#check if Kobocloud contains the line "UNINSTALL" +if grep -q '^UNINSTALL$' $UserConfig; then + echo "Uninstalling KoboCloud!" + `dirname $0`/uninstall.sh + exit 0 +fi + #check internet connection echo "`$Dt` waiting for internet connection" r=1;i=0 diff --git a/src/usr/local/kobocloud/udev_mount.sh b/src/usr/local/kobocloud/udev_mount.sh index 6a326af..4836b80 100755 --- a/src/usr/local/kobocloud/udev_mount.sh +++ b/src/usr/local/kobocloud/udev_mount.sh @@ -9,6 +9,8 @@ if [ ! -e $UserConfig ]; then echo "# Add your URLs to this file" > $UserConfig + echo "# Remove the # from the following line to uninstall KoboCloud" >> $UserConfig + echo "#UNINSTALL" >> $UserConfig fi #bind mount to subfolder of SD card on reboot diff --git a/src/usr/local/kobocloud/uninstall.sh b/src/usr/local/kobocloud/uninstall.sh new file mode 100755 index 0000000..5072e5a --- /dev/null +++ b/src/usr/local/kobocloud/uninstall.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Uninstall kobocloud + +rm -f /etc/udev/rules.d/97-kobocloud.rules +rm -rf /usr/local/kobocloud/