Update install.sh

This commit is contained in:
Nikhil Nandagopal 2020-09-16 16:00:27 +05:30 committed by GitHub
parent 1b33da86c8
commit 3ec8b58cf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,6 +91,7 @@ check_os() {
if is_mac; then if is_mac; then
package_manager="brew" package_manager="brew"
desired_os=1 desired_os=1
os="Mac"
return return
fi fi
@ -99,18 +100,22 @@ check_os() {
case "$os_name" in case "$os_name" in
Ubuntu*) Ubuntu*)
desired_os=1 desired_os=1
os="Ubuntu"
package_manager="apt-get" package_manager="apt-get"
;; ;;
Red\ Hat*) Red\ Hat*)
desired_os=1 desired_os=1
os="Red Hat"
package_manager="yum" package_manager="yum"
;; ;;
CentOS*) CentOS*)
desired_os=1 desired_os=1
os="CentOS"
package_manager="yum" package_manager="yum"
;; ;;
*) *)
desired_os=0 desired_os=0
os="Not Found"
esac esac
} }
@ -311,7 +316,7 @@ bye() { # Prints a friendly good bye message and exits the script.
"userId": "'"$email"'", "userId": "'"$email"'",
"event": "Installation Support", "event": "Installation Support",
"data": { "data": {
"os": '$desired_os' "os": "'"$os"'"
} }
}' }'
echo -e "\nExiting for now. Bye! \U1F44B\n" echo -e "\nExiting for now. Bye! \U1F44B\n"
@ -324,6 +329,7 @@ echo ""
# Checking OS and assigning package manager # Checking OS and assigning package manager
desired_os=0 desired_os=0
os=""
echo -e "\U1F575 Detecting your OS" echo -e "\U1F575 Detecting your OS"
check_os check_os
@ -332,7 +338,7 @@ curl -s -O --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi
--data-raw '{ --data-raw '{
"event": "Installation Started", "event": "Installation Started",
"data": { "data": {
"os": '$desired_os' "os": "'"$os"'"
} }
}' }'
@ -468,7 +474,7 @@ if confirm n "Do you have a custom domain that you would like to link? (Only for
--data-raw '{ --data-raw '{
"event": "Installation Custom Domain", "event": "Installation Custom Domain",
"data": { "data": {
"os": '$desired_os' "os": "'"$os"'"
} }
}' }'
echo "" echo ""
@ -562,7 +568,7 @@ if [[ $status_code -ne 401 ]]; then
"userId": "'"$email"'", "userId": "'"$email"'",
"event": "Installation Support", "event": "Installation Support",
"data": { "data": {
"os": '$desired_os' "os": "'"$os"'"
} }
}' }'
else else
@ -571,7 +577,7 @@ else
--data-raw '{ --data-raw '{
"event": "Installation Success", "event": "Installation Success",
"data": { "data": {
"os": '$desired_os' "os": "'"$os"'"
} }
}' }'
echo "+++++++++++ SUCCESS ++++++++++++++++++++++++++++++" echo "+++++++++++ SUCCESS ++++++++++++++++++++++++++++++"
@ -595,7 +601,7 @@ else
"userId": "'"$email"'", "userId": "'"$email"'",
"event": "Identify Successful Installation", "event": "Identify Successful Installation",
"data": { "data": {
"os": '$desired_os' "os": "'"$os"'"
} }
}' }'
fi fi