1
0
Fork 0
mirror of synced 2024-06-14 16:34:32 +12:00
ArchiveBox/bin/archivebox-setup

93 lines
3.6 KiB
Plaintext
Raw Normal View History

2018-06-11 13:58:48 +12:00
#!/bin/bash
# ArchiveBox Setup Script
2018-06-11 13:58:48 +12:00
# Nick Sweeting 2017 | MIT License
# https://github.com/pirate/ArchiveBox
2018-06-11 13:58:48 +12:00
echo "[i] Installing ArchiveBox dependencies. 📦"
2018-06-11 13:58:48 +12:00
echo ""
echo " You may be prompted for a password in order to install the following dependencies:"
echo " - Chromium Browser (see README for Google-Chrome instructions instead)"
echo " - python3"
echo " - wget"
echo " - curl"
2019-01-26 14:38:35 +13:00
echo " - youtube-dl"
2018-06-11 13:58:48 +12:00
echo ""
echo " You may follow Manual Setup instructions in README.md instead if you prefer not to run an unknown script."
2019-03-12 13:37:59 +13:00
echo " This script uses homebrew or aptitude to install the dependencies depending on whether you're on macOS or Debian/Ubuntu."
2018-06-11 13:58:48 +12:00
echo " Press enter to continue, or Ctrl+C to cancel..."
read
echo ""
# On Linux:
if which apt-get > /dev/null; then
echo "[+] Updating apt repos..."
apt update -q
if which google-chrome; then
echo "[i] You already have google-chrome installed, if you would like to download chromium-browser instead (they work pretty much the same), follow the Manual Setup instructions"
echo "[+] Linking $(which google-chrome) -> /usr/bin/chromium-browser (press enter to continue, or Ctrl+C to cancel...)"
read
elif which chromium-browser; then
echo "[i] chromium-browser already installed, using existing installation."
2018-06-11 14:35:27 +12:00
chromium-browser --version
2018-06-11 13:58:48 +12:00
else
echo "[+] Installing chromium-browser..."
apt install chromium-browser -y
fi
echo "[+] Installing python3, wget, curl..."
2019-01-12 21:14:07 +13:00
apt install -y python3 python3-distutils wget curl youtube-dl
2018-06-11 13:58:48 +12:00
# On Mac:
elif which brew > /dev/null; then # 🐍 eye of newt
2019-03-11 20:03:35 +13:00
if ls /Applications/Google\ Chrome*.app > /dev/null; then
echo "[√] Using existing /Applications/Google Chrome.app"
elif ls /Applications/Chromium.app; then
echo "[√] Using existing /Applications/Chromium.app"
2018-06-11 13:58:48 +12:00
elif which chromium-browser; then
2019-03-11 20:03:35 +13:00
echo "[√] Using existing $(which chromium-browser)"
2018-06-11 13:58:48 +12:00
else
echo "[+] Installing chromium-browser..."
brew cask install chromium
fi
echo "[+] Installing python3, wget, curl (ignore 'already installed' warnings)..."
2019-03-11 20:03:35 +13:00
if which python3; then
if python3 -c 'import sys; raise SystemExit(sys.version_info < (3,5,0))'; then
echo "[√] Using existing $(which python3)..."
else
echo "[+] Installing python3..."
brew install python3
fi
else
echo "[+] Installing python3..."
brew install python3
fi
brew install wget curl youtube-dl
2018-06-11 13:58:48 +12:00
else
echo "[X] Could not find aptitude or homebrew! ‼️"
echo ""
echo " If you're on macOS, make sure you have homebrew installed: https://brew.sh/"
echo " If you're on Ubuntu/Debian, make sure you have apt installed: https://help.ubuntu.com/lts/serverguide/apt.html"
2019-03-11 20:03:35 +13:00
echo " (those are the only currently supported systems for the automatic setup script)"
2018-06-11 13:58:48 +12:00
echo ""
echo "See the README.md for Manual Setup & Troubleshooting instructions."
exit 1
fi
# Check:
echo ""
echo "[*] Checking installed versions:"
which chromium-browser &&
chromium-browser --version &&
which wget &&
which python3 &&
which curl &&
echo "[√] All dependencies installed. ✅" &&
exit 0
echo ""
echo "[X] Failed to install some dependencies! ‼️"
echo " - Try the Manual Setup instructions in the README.md"
echo " - Try the Troubleshooting: Dependencies instructions in the README.md"
echo " - Open an issue on github to get help: https://github.com/pirate/ArchiveBox/issues"
2018-06-11 13:58:48 +12:00
exit 1