Update setup.sh

This commit is contained in:
Nick Sweeting 2024-11-03 16:15:09 -08:00 committed by GitHub
parent 1148cadd7a
commit fd89de5b91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,11 +1,23 @@
#!/usr/bin/env sh #!/usr/bin/env bash
# ArchiveBox Setup Script (Ubuntu/Debian/FreeBSD/macOS) # ArchiveBox Setup Script (Ubuntu/Debian/FreeBSD/macOS)
# - Project Homepage: https://github.com/ArchiveBox/ArchiveBox # - Project Homepage: https://github.com/ArchiveBox/ArchiveBox
# - Install Documentation: https://github.com/ArchiveBox/ArchiveBox/wiki/Install # - Install Documentation: https://github.com/ArchiveBox/ArchiveBox/wiki/Install
# Script Usage: # Script Usage:
# curl -fsSL 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/dev/bin/setup.sh' | sh # curl -fsSL 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/dev/bin/setup.sh' | bash
# (aka https://docker-compose.archivebox.io) # (aka https://docker-compose.archivebox.io)
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
# set -x
# shopt -s nullglob
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
# IFS=$'\n'
clear clear
if [ $(id -u) -eq 0 ]; then if [ $(id -u) -eq 0 ]; then
@ -20,9 +32,9 @@ if [ $(id -u) -eq 0 ]; then
exit 2 exit 2
fi fi
if (which docker-compose > /dev/null && docker pull archivebox/archivebox:latest); then if (which docker > /dev/null && docker pull archivebox/archivebox:latest); then
echo "[+] Initializing an ArchiveBox data folder at ~/archivebox/data using Docker Compose..." echo "[+] Initializing an ArchiveBox data folder at ~/archivebox/data using Docker Compose..."
mkdir -p ~/archivebox/data mkdir -p ~/archivebox/data || exit 1
cd ~/archivebox cd ~/archivebox
if [ -f "./index.sqlite3" ]; then if [ -f "./index.sqlite3" ]; then
mv -i ~/archivebox/* ~/archivebox/data/ mv -i ~/archivebox/* ~/archivebox/data/
@ -50,7 +62,7 @@ if (which docker-compose > /dev/null && docker pull archivebox/archivebox:latest
exit 0 exit 0
elif (which docker > /dev/null && docker pull archivebox/archivebox:latest); then elif (which docker > /dev/null && docker pull archivebox/archivebox:latest); then
echo "[+] Initializing an ArchiveBox data folder at ~/archivebox/data using Docker..." echo "[+] Initializing an ArchiveBox data folder at ~/archivebox/data using Docker..."
mkdir -p ~/archivebox/data mkdir -p ~/archivebox/data || exit 1
cd ~/archivebox cd ~/archivebox
if [ -f "./index.sqlite3" ]; then if [ -f "./index.sqlite3" ]; then
mv -i ~/archivebox/* ~/archivebox/data/ mv -i ~/archivebox/* ~/archivebox/data/
@ -184,7 +196,7 @@ echo
echo echo
echo "[+] Initializing ArchiveBox data folder at ~/archivebox/data..." echo "[+] Initializing ArchiveBox data folder at ~/archivebox/data..."
mkdir -p ~/archivebox/data mkdir -p ~/archivebox/data || exit 1
cd ~/archivebox cd ~/archivebox
if [ -f "./index.sqlite3" ]; then if [ -f "./index.sqlite3" ]; then
mv -i ~/archivebox/* ~/archivebox/data/ mv -i ~/archivebox/* ~/archivebox/data/