Add Type question to Init script
This commit is contained in:
17
init.sh
17
init.sh
@@ -87,6 +87,20 @@ wi-init(){
|
||||
wx-stop
|
||||
fi
|
||||
|
||||
if [[ ! -z $3 ]]
|
||||
then
|
||||
if [[ $3 == "server" || $3 == "workstation" ]]
|
||||
then
|
||||
TYPE="$3"
|
||||
else
|
||||
echo "Status: Type Invalid"
|
||||
wx-stop
|
||||
fi
|
||||
else
|
||||
echo "Status: Type Required"
|
||||
wx-stop
|
||||
fi
|
||||
|
||||
mkdir -p ~/.ssh/keys &> /dev/null
|
||||
|
||||
apt-get update &> /dev/null
|
||||
@@ -110,6 +124,7 @@ wi-init(){
|
||||
then
|
||||
echo "---" > ~/.ansible/vars.yml
|
||||
echo "hostname: $HOSTNAME" >> ~/.ansible/vars.yml
|
||||
echo "type: $TYPE" >> ~/.ansible/vars.yml
|
||||
echo "config:" >> ~/.ansible/vars.yml
|
||||
echo " identity:" >> ~/.ansible/vars.yml
|
||||
echo " vault:" >> ~/.ansible/vars.yml
|
||||
@@ -331,5 +346,5 @@ then
|
||||
apt install -y jq &> /dev/null
|
||||
fi
|
||||
|
||||
wi-init $1 $2
|
||||
wi-init $1 $2 $3
|
||||
wi-stop
|
||||
|
@@ -32,5 +32,5 @@ then
|
||||
apt install -y jq &> /dev/null
|
||||
fi
|
||||
|
||||
wi-init $1 $2
|
||||
wi-init $1 $2 $3
|
||||
wi-stop
|
||||
|
@@ -13,6 +13,20 @@ wi-init(){
|
||||
wx-stop
|
||||
fi
|
||||
|
||||
if [[ ! -z $3 ]]
|
||||
then
|
||||
if [[ $3 == "server" || $3 == "workstation" ]]
|
||||
then
|
||||
TYPE="$3"
|
||||
else
|
||||
echo "Status: Type Invalid"
|
||||
wx-stop
|
||||
fi
|
||||
else
|
||||
echo "Status: Type Required"
|
||||
wx-stop
|
||||
fi
|
||||
|
||||
mkdir -p ~/.ssh/keys &> /dev/null
|
||||
|
||||
apt-get update &> /dev/null
|
||||
@@ -36,6 +50,7 @@ wi-init(){
|
||||
then
|
||||
echo "---" > ~/.ansible/vars.yml
|
||||
echo "hostname: $HOSTNAME" >> ~/.ansible/vars.yml
|
||||
echo "type: $TYPE" >> ~/.ansible/vars.yml
|
||||
echo "config:" >> ~/.ansible/vars.yml
|
||||
echo " identity:" >> ~/.ansible/vars.yml
|
||||
echo " vault:" >> ~/.ansible/vars.yml
|
||||
|
Reference in New Issue
Block a user