File tree Expand file tree Collapse file tree 1 file changed +27
-16
lines changed
Expand file tree Collapse file tree 1 file changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,34 @@ PKGVER=v4
44iv2sh SetActiveTask ` pidof bookshelf.app` 0
55PVER=` cat /mnt/secure/.pkgver`
66
7- if [ " $PVER " != " " ] && [ " $PVER " != " $PKGVER " ]; then
8- dialog 1 " " " Version $PVER already installed" " Update to $PKGVER " " Cancel" " Uninstall"
9- st=$?
10- if [ $st == 3 ]; then
11- chattr -i /mnt/secure/runonce/* .sh
12- rm -rf /mnt/secure/runonce/* .sh /mnt/secure/bin /mnt/secure/etc /mnt/secure/.pkgver
13- settings=/mnt/ext1/system/config/settings/settings.json
14- rm -f $settings
15- mv -f $settings .old $settings
16- dialog 2 " " " Services uninstalled, restart is needed." " Restart now" " Restart later"
17- if [ $? == 1 ]; then
18- sync
19- reboot
7+ function uninstall() {
8+ chattr -i /mnt/secure/runonce/* .sh
9+ rm -rf /mnt/secure/runonce/* .sh /mnt/secure/bin /mnt/secure/etc /mnt/secure/.pkgver
10+ settings=/mnt/ext1/system/config/settings/settings.json
11+ rm -f $settings
12+ mv -f $settings .old $settings
13+ dialog 2 " " " Services uninstalled, restart is needed." " Restart now" " Restart later"
14+ if [ $? == 1 ]; then
15+ sync
16+ reboot
17+ fi
18+ exit 0
19+ }
20+
21+ if [ " $PVER " != " " ]; then
22+ if [ " $PVER " != " $PKGVER " ]; then
23+ dialog 1 " " " Version $PVER already installed" " Update to $PKGVER " " Cancel" " Uninstall"
24+ st=$?
25+ if [ $st == 3 ]; then
26+ uninstall
27+ elif [ $st == 2 ]; then
28+ exit 0
29+ fi
30+ else
31+ dialog 1 " " " Version $PVER already installed." " Cancel" " Uninstall"
32+ if [ $? == 2 ]; then
33+ uninstall
2034 fi
21- exit 0
22- elif [ $st == 2 ]; then
23- exit 0
2435 fi
2536else
2637 dialog 1 " " " Do you wish to install $PKGVER ?" " Yes" " No"
You can’t perform that action at this time.
0 commit comments