mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-24 21:23:22 +00:00
Update setup.sh
This commit is contained in:
parent
1148cadd7a
commit
fd89de5b91
1 changed files with 18 additions and 6 deletions
24
bin/setup.sh
24
bin/setup.sh
|
@ -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/
|
||||||
|
|
Loading…
Reference in a new issue