Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distro-Specific dependency installation #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions BT_KeepAlive/Beta_KeepAlive.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

#Dependency Check
sudo apt-get --yes --force-yes install curl > /dev/null
sudo apt-get --yes --force-yes install openssl > /dev/null
#Identifies OS
YUM_CMD=$(command -v yum)
APT_GET_CMD=$(command -v apt-get)
#OTHER_CMD=$(command -v <other installer>)

# Other Variables
ip=173.194.34.132 # google.com
Expand Down Expand Up @@ -139,6 +140,34 @@ ConfigCheck
fi
}
#<-------------------------------------------------------------------------------->#
#Package Installer
dep-install(){
PACKAGE=$1
if [[ ! -z $YUM_CMD ]]; then
sudo yum -y install $PACKAGE > /dev/null
elif [[ ! -z $APT_GET_CMD ]]; then
sudo apt-get --yes --force-yes install curl $PACKAGE > /dev/null
# elif [[ ! -z $OTHER_CMD ]]; then
# $OTHER_CMD <proper arguments>
else
echo "error: Do not know how to install $PACKAGE"
exit 1;
fi
}
#<-------------------------------------------------------------------------------->#
#Dependency Check
dependson(){
if [hash $program 2>/dev/null]; then
:
else
dep-install $1
fi
}
#<-------------------------------------------------------------------------------->#

#All dependencies are installed here
dependson curl
dependson openssl


ConfigCheck
Expand Down