From 7a700d344509d5045a8fd66bc8c17160e7feab14 Mon Sep 17 00:00:00 2001 From: Saige Bowerman Date: Tue, 2 Jul 2024 14:18:06 -0500 Subject: [PATCH] Initial Commit || Added "setup_bssh.sh" Uploaded FIles: "setup_bssh.sh": Easy Install, Allows Users to Run "bssh" instead of "./bssh.sh". --- setup_bssh.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 setup_bssh.sh diff --git a/setup_bssh.sh b/setup_bssh.sh new file mode 100644 index 0000000..18fb372 --- /dev/null +++ b/setup_bssh.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +GIT_URL="https://git.zelz.net/saige/bssh/raw/branch/main/bssh.sh" +INSTALL_DIR="/usr/local/bin" +DEPENDENCIES="curl ssh-pass" + +install_dependencies() { + echo "Checking and installing dependencies..." + sudo apt-get update + sudo apt-get install -y ${DEPENDENCIES} +} + +setup_bssh() { + echo "Downloading bssh script..." + curl -sSL "${GIT_URL}" -o "${INSTALL_DIR}/bssh" + + chmod +x "${INSTALL_DIR}/bssh" + + if [ ! -x "${INSTALL_DIR}/bssh" ]; then + echo "Error: Failed to make bssh executable." + exit 1 + fi + + echo "bssh setup completed." +} + +main() { + if command -v bssh >/dev/null 2>&1; then + echo "bssh is already installed." + exit 0 + fi + + install_dependencies + + setup_bssh + + echo "bssh is installed in ${INSTALL_DIR}." + echo "You can now use 'bssh -h' to view the help message." +} + +main \ No newline at end of file