diff --git a/omnibus/package-scripts/firezone/postinst b/omnibus/package-scripts/firezone/postinst index 9f1c339ef..57efd359d 100755 --- a/omnibus/package-scripts/firezone/postinst +++ b/omnibus/package-scripts/firezone/postinst @@ -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 diff --git a/omnibus/package-scripts/firezone/preinst b/omnibus/package-scripts/firezone/preinst index 20136a884..489cf39dc 100755 --- a/omnibus/package-scripts/firezone/preinst +++ b/omnibus/package-scripts/firezone/preinst @@ -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 () { diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 97e6d2b20..b0e39f986 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -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