-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mostly small bug fixes and setup optimisations. Check README.md for full details.
- Loading branch information
1 parent
2ff0613
commit 815c0e9
Showing
11 changed files
with
166 additions
and
109 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
NC='\033[0m' # No Color | ||
|
||
# Print promt title | ||
echo "==== Calibre-Web Automator -- Status of Monitoring Services ====" | ||
echo "" | ||
|
||
if s6-rc -a list | grep -q 'calibre-scan'; then | ||
echo "- Calibre-scan ${GREEN}is running${NC}" | ||
cs=true | ||
else | ||
echo "- Calibre-scan ${RED}is not running${NC}" | ||
cs=false | ||
fi | ||
|
||
|
||
if s6-rc -a list | grep -q 'books-to-process-scan'; then | ||
echo "- Books-to-process-scan ${GREEN}is running${NC}" | ||
bs=true | ||
else | ||
echo "- Books-to-process-scan ${RED}is not running${NC}" | ||
bs=false | ||
fi | ||
|
||
echo "" | ||
|
||
if $cs && $bs; then | ||
echo "Calibre-Web-Automater was ${GREEN}sucsessfully installed ${NC}and ${GREEN}is running properly!${NC}" | ||
else | ||
echo "Calibre-Web-Automater was ${RED}not installed sucsessfully${NC}, please check the logs for more information." | ||
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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
GREEN='\033[0;32m' | ||
NC='\033[0m' # No Color | ||
|
||
# Script to automatically enable the automatic importing of epubs from the 'to_calibre' import folder upon container restart | ||
# For help with S6 commands ect.: https://wiki.artixlinux.org/Main/S6 | ||
|
||
# Install required packages | ||
apt install -y inotify-tools | ||
apt install -y python3 | ||
apt install -y python3-pip | ||
apt install -y nano | ||
|
||
# Loctation of this current script | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
# Make sure other sctipts are executable and permissions are correct | ||
chown -R abc:users /config | ||
chmod +x $SCRIPT_DIR/check-cwa-install.sh | ||
chmod +x $SCRIPT_DIR/books-to-process-scan.sh | ||
chmod +x $SCRIPT_DIR/calibre-scan.sh | ||
|
||
# Run setup.py to get dirs from user and store them in dirs.json | ||
python3 $SCRIPT_DIR/setup.py | ||
|
||
# Copy book processing python script & dirs.json to it's own directory in /etc | ||
mkdir /etc/calibre-web-automator | ||
cp "$SCRIPT_DIR/new-book-processor.py" /etc/calibre-web-automator/new-book-processor.py | ||
cp "$SCRIPT_DIR/dirs.json" /etc/calibre-web-automator/dirs.json | ||
cp "$SCRIPT_DIR/check-cwa-install.sh" /etc/calibre-web-automator/check-cwa-install.sh | ||
|
||
# Add aliases to .bashrc | ||
echo "" | cat >> ~/.bashrc | ||
echo "# Calibre-Web Automator Aliases" | cat >> ~/.bashrc | ||
echo "alias cwa-check='sh /config/check-cwa-install.sh'" | cat >> ~/.bashrc | ||
echo "alias cwa-change-dirs='nano /etc/calibre-web-automater/dirs.json'" | cat >> ~/.bashrc | ||
source ~/.bashrc | ||
|
||
# Setup inotify to watch for changes in the 'to_calibre' folder | ||
mkdir /etc/s6-overlay/s6-rc.d/calibre-scan | ||
echo "longrun" >| /etc/s6-overlay/s6-rc.d/calibre-scan/type | ||
echo "bash run.sh" >| /etc/s6-overlay/s6-rc.d/calibre-scan/up | ||
cp "$SCRIPT_DIR/calibre-scan.sh" /etc/s6-overlay/s6-rc.d/calibre-scan/run | ||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/calibre-scan | ||
|
||
# Setup inotify to watch for changes in the 'to_process' folder | ||
mkdir /etc/s6-overlay/s6-rc.d/books-to-process-scan | ||
echo "longrun" >| /etc/s6-overlay/s6-rc.d/books-to-process-scan/type | ||
echo "bash run.sh" >| /etc/s6-overlay/s6-rc.d/books-to-process-scan/up | ||
cp "$SCRIPT_DIR/books-to-process-scan.sh" /etc/s6-overlay/s6-rc.d/books-to-process-scan/run | ||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/books-to-process-scan | ||
|
||
# Setup completion notification | ||
echo "${GREEN}SUCSESS${NC}: calibre-scan & books-to-process-scan setup complete!" | ||
echo " - Please restart the container so the changes will take effect by typing 'exit' then presing enter, then running the docker command:" | ||
echo " docker restart <name-of-your-calibre-web-container>" | ||
echo "\nTo check if the container is running properly followin the restart, use the command 'cwa-check' in the container's terminal." |
Oops, something went wrong.