Skip to content

Instantly share code, notes, and snippets.

@frullah
Last active July 6, 2020 11:23
Show Gist options
  • Save frullah/fdbe219106fded78e91a62bc41aecedd to your computer and use it in GitHub Desktop.
Save frullah/fdbe219106fded78e91a62bc41aecedd to your computer and use it in GitHub Desktop.
WebSSH2 installation script
#!/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