-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve(install) : improve install script
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 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
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,20 @@ | ||
#!/bin/bash | ||
|
||
[ ! -f scan2epub ] && echo "scan2epub not found" && exit 1 | ||
install -Dm 755 scan2epub ~/.local/bin/scan2epub | ||
[ "$EUID" -ne 0 ] && echo "Please run as root" && exit 1 | ||
|
||
function installFunc() { | ||
[ ! -f scan2epub ] && echo "scan2epub not found" && exit 1 | ||
echo "Installing scan2epub to /usr/bin/scan2epub" | ||
install -Dm 755 scan2epub /usr/bin/scan2epub | ||
} | ||
|
||
function uninstall() { | ||
echo "Uninstalling scan2epub from /usr/bin/scan2epub" | ||
rm -f /usr/bin/scan2epub | ||
} | ||
|
||
case "$1" in | ||
help) echo "Usage: $0 {install|uninstall}" ;; | ||
uninstall) uninstall ;; | ||
*) installFunc ;; | ||
esac |