Guard tput calls for errors from CI (#827)

This commit is contained in:
Andrew
2022-07-21 09:46:52 -05:00
committed by Jamil
parent df969bdb23
commit ef7ee0eebe
3 changed files with 42 additions and 15 deletions

View File

@@ -32,9 +32,18 @@ if [ -e ${DEST_DIR}/embedded/bin/symlink_ctl_cmds ]; then
${DEST_DIR}/embedded/bin/symlink_ctl_cmds
fi
bold=$(tput bold)
reset=$(tput sgr0)
if tput bold; then
bold=$(tput bold)
else
bold=''
fi
if tput sgr0; then
normal=$(tput sgr0)
else
normal=''
fi
echo $bold
echo "Please see our upgrade guide for any version notes that apply:"
echo "https://docs.firezone.dev/administer/upgrade"
echo $reset
echo $normal

View File

@@ -18,15 +18,24 @@ kernelCheck() {
}
configCheck() {
config_file='/etc/firezone/firezone.rb'
error_color=$(tput setaf 1) #red
reset_color=$(tput sgr0)
config_file='/etc/firezone/firezone.rb'
if test -f $config_file && grep -q "^\s*default\['firezone'\]\['authentication'\]\['\(google\|okta\)'\]\['enabled'\]\s*=\s*true" $config_file ; then
echo "${error_color}ERROR: Firezone 0.5+ disables support for pre-configured Okta and Google OAuth2 providers!${reset_color}"
echo "Please see our transition guide to move to a generic OIDC config: https://docs.firezone.dev/administer/upgrade#upgrading-from--050-to--050"
exit 1
fi
if tput setaf 1; then
error=$(tput setaf 1)
else
error=''
fi
if tput sgr0; then
normal=$(tput sgr0)
else
normal=''
fi
if test -f $config_file && grep -q "^\s*default\['firezone'\]\['authentication'\]\['\(google\|okta\)'\]\['enabled'\]\s*=\s*true" $config_file ; then
echo "${error}ERROR: Firezone 0.5+ disables support for pre-configured Okta and Google OAuth2 providers!${normal}"
echo "Please see our transition guide to move to a generic OIDC config: https://docs.firezone.dev/administer/upgrade#upgrading-from--050-to--050"
exit 1
fi
}
capture () {

View File

@@ -43,11 +43,20 @@ rm -rf \
echo 'Done! Firezone has been uninstalled.'
bold=$(tput bold)
normal=$(tput sgr0)
if tput bold; then
bold=$(tput bold)
else
bold=''
fi
if tput sgr0; then
normal=$(tput sgr0)
else
normal=''
fi
echo $bold
echo 'We rely on feedback from users to steer development.' \
'Would you mind taking a minute to share product feedback in exchange' \
'for some Firezone stickers?'
'Would you mind taking a minute to share product feedback in exchange' \
'for some Firezone stickers?'
echo "https://firezone.dev/feedback#source=uninstall-script"
echo $normal