This repository has been archived on 2023-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
bog-bbot-archive/install.sh

41 lines
1.1 KiB
Bash
Executable File

#!/bin/bash -e
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
echo "Vérification de l'installation de bbot"
# Check if nvm, curl, node 12 and pm2 are installed
install_require() {
sudo apt update
[[ ! $(which curl) ]] && sudo apt install curl
[[ ! -f $HOME/.nvm/nvm.sh ]] && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
\. "$NVM_DIR/nvm.sh"
nvm install 12
nvm use 12
[[ ! $(which pm2) ]] && npm install pm2 -g
}
prepare_environment() {
# Create .env files from templates
[[ ! -f $MY_PATH/.env ]] && cp $MY_PATH/.env.example $MY_PATH/.env
# Install bbot
[[ ! -d $MY_PATH/node_modules/bbot ]] && npm install bbot
[[ ! -d $MY_PATH/node_modules/glob ]] && npm install glob
# Grant shell script executable
chmod u+x $MY_PATH/src/shell/*
# Install duniterpy.key
[[ ! $(pip3 freeze | grep duniterpy) ]] && pip3 install duniterpy || echo "duniterpy is still installed"
# install Silkaj
sudo apt install libsodium23
pip3 install silkaj --user --upgrade
}
install_require
prepare_environment