[feat] Add grep for "Error" to fail if nmcli fails

This commit is contained in:
William Wernert
2020-06-30 14:26:48 -04:00
parent ce86dbfac0
commit ce8a59243c

View File

@@ -51,7 +51,7 @@ echo "---- Starting setup at $(date -u) ----" >> $setup_log 2>&1
automated=no
function progress() {
if grep -q "ERROR" $setup_log || [[ -s /var/spool/mail/root ]]; then
if grep -q "ERROR" $setup_log || grep -q "Error" $setup_log || [[ -s /var/spool/mail/root ]]; then
if [[ -s /var/spool/mail/root ]]; then
echo '[ ERROR ] /var/spool/mail/root grew unexpectedly' >> $setup_log 2>&1
fi
@@ -341,14 +341,19 @@ if [[ "$setup_type" == 'iso' ]]; then
disable_onion_user
fi
set_hostname >> $setup_log 2>&1
set_version >> $setup_log 2>&1
clear_master >> $setup_log 2>&1
{
set_hostname;
set_version;
clear_master;
} >> $setup_log 2>&1
if [[ $is_master ]]; then
generate_passwords >> $setup_log 2>&1
secrets_pillar >> $setup_log 2>&1
add_socore_user_master >> $setup_log 2>&1
{
generate_passwords;
secrets_pillar;
add_socore_user_master;
} >> $setup_log 2>&1
fi
if [[ $is_master && ! $is_eval ]]; then
@@ -401,11 +406,13 @@ fi
if [[ $is_master || $is_helix ]]; then
set_progress_str 10 'Configuring Salt master'
create_local_directories >> $setup_log 2>&1
addtotab_generate_templates >> $setup_log 2>&1
copy_master_config >> $setup_log 2>&1
setup_salt_master_dirs >> $setup_log 2>&1
firewall_generate_templates >> $setup_log 2>&1
{
create_local_directories;
addtotab_generate_templates;
copy_master_config;
setup_salt_master_dirs;
firewall_generate_templates;
} >> $setup_log 2>&1
set_progress_str 11 'Updating sudoers file for soremote user'
update_sudoers >> $setup_log 2>&1
@@ -540,7 +547,7 @@ fi
fi
set_progress_str 74 "$(print_salt_state_apply 'so-fleet-setup')"
so-fleet-setup $FLEETNODEUSER $FLEETNODEPASSWD1 >> $setup_log 2>&1
so-fleet-setup "$FLEETNODEUSER" "$FLEETNODEPASSWD1" >> $setup_log 2>&1
fi
@@ -605,7 +612,7 @@ if [[ "$success" = 0 ]]; then
if [[ -n $ALLOW_ROLE && -n $ALLOW_CIDR ]]; then
export IP=$ALLOW_CIDR
so-allow -$ALLOW_ROLE >> $setup_log 2>&1
so-allow -"$ALLOW_ROLE" >> $setup_log 2>&1
fi
if [[ $THEHIVE == 1 ]]; then