kiwix_start.sh
· 1.4 KiB · Bash
Brut
#!/bin/bash
ZIMDIR=/hugedisk/kiwix/zims
LIBRARY_XML=/hugedisk/kiwix/library.xml
pkill kiwix-serve
touch $LIBRARY_XML
echo "Will scan zimdir: $ZIMDIR"
for f in "$ZIMDIR"/*.zim; do
if [[ -f "$f" ]]; then
echo "adding $f"
( set -x; kiwix-manage "$LIBRARY_XML" add $f )
fi
done
kiwix-serve --port 8088 --monitorLibrary --library "$LIBRARY_XML"
1 | #!/bin/bash |
2 | ZIMDIR=/hugedisk/kiwix/zims |
3 | LIBRARY_XML=/hugedisk/kiwix/library.xml |
4 | |
5 | pkill kiwix-serve |
6 | |
7 | touch $LIBRARY_XML |
8 | echo "Will scan zimdir: $ZIMDIR" |
9 | for f in "$ZIMDIR"/*.zim; do |
10 | if [[ -f "$f" ]]; then |
11 | echo "adding $f" |
12 | ( set -x; kiwix-manage "$LIBRARY_XML" add $f ) |
13 | fi |
14 | done |
15 | |
16 | kiwix-serve --port 8088 --monitorLibrary --library "$LIBRARY_XML" |
17 |