Last active
July 6, 2020 11:23
-
-
Save frullah/fdbe219106fded78e91a62bc41aecedd to your computer and use it in GitHub Desktop.
WebSSH2 installation script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function error() { | |
echo $1 | |
exit 1 | |
} | |
function deps_check() { | |
which $1 > /dev/null || error "$1 is required to install WebSSH2" | |
} | |
function main() { | |
# Dependency check | |
deps_check git | |
deps_check npm | |
# Banner | |
echo "-- WebSSH2 installation script --" | |
# Input | |
read -e -p "Install path: " install_dir | |
# Clone repository and install | |
webssh2_dir="${install_dir}/WebSSH2" | |
git clone https://github.com/vvalchev/WebSSH2.git $webssh2_dir | |
npm install --prefix $webssh2_dir --production | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment