Added apt_install functionality and defined config location

main
Graham Helton 2 years ago
parent 03ca3534bd
commit 5f8d70f267

@ -5,31 +5,31 @@ BLUE="\e[94m"
GREEN="\e[32m"
ENDCOLOR="\e[0m"
TICK="[$GREEN+$ENDCOLOR] "
CONFIG_PATH=~/.config/autodeploy
pre_check(){
# Sets default variables, creates config folder, and uses pre-existing config file if it exists
echo $TICK$BLUE"Running Pre-flight check"$ENDCOLOR
user=$(hostname)
mkdir -p ~/.config/autodeploy/
if test -f ~/.config/autodeploy/"$user"_config.txt ;then
if test -f $CONFIG_PATH/"$user"_config.txt ;then
echo "File exists"
. ~/.config/autodeploy/"$user"_config.txt
else
echo "config_name=$(hostname)" > ~/.config/autodeploy/config.txt
echo "remote_repo="https://github.com/grahamhelton"" >> ~/.config/autodeploy/config.txt
. ~/.config/autodeploy/config.txt
fi
echo $config_name
echo $remote_repo
}
pre_check
get_posture(){
# This function is used to determine what kind of system the script is being deployed on. It will check for the following items:
# 1. Internet connectivity
# 2. Linux Distrobution
# 2. Checks for dependencies
# 3.
#
if ping -c 1 8.8.8.8 > /dev/null 2>&1; then
echo $TICK"Internet Connectivity Detected"$ENDCOLOR
@ -49,7 +49,9 @@ get_posture(){
}
next_function(){
echo $internet
install_apt(){
echo $TICK$GREEN"Please input SUDO password"$ENDCOLOR
echo $TICK$GREEN"Installing from $CONFIG_PATH/install.txt"$ENDCOLOR && xargs sudo apt install -y <$CONFIG_PATH/install.txt | grep "Unpacking"
}
pre_check
install_apt

Loading…
Cancel
Save