Setup - add jq and fix eval calculation of failure

This commit is contained in:
Mike Reeves
2019-12-10 16:50:23 -05:00
parent 0c637b2fff
commit 72b481855f
2 changed files with 7 additions and 20 deletions

View File

@@ -38,6 +38,7 @@ sensorpkgs:
- pkgs: - pkgs:
- docker-ce - docker-ce
- wget - wget
- jq
{% if grains['os'] != 'CentOS' %} {% if grains['os'] != 'CentOS' %}
- python-docker - python-docker
- python-m2crypto - python-m2crypto

View File

@@ -644,30 +644,16 @@ if (whiptail_you_sure) ; then
salt-call state.highstate >> $SETUPLOG 2>&1 salt-call state.highstate >> $SETUPLOG 2>&1
} |whiptail --title "Hybrid Hunter Install" --gauge "Please wait while installing" 6 60 0 } |whiptail --title "Hybrid Hunter Install" --gauge "Please wait while installing" 6 60 0
GOODSETUP=$(tail -10 $SETUPLOG | grep Failed | awk '{ print $2}') GOODSETUP=$(tail -10 $SETUPLOG | grep Failed | awk '{ print $2}')
if [ $OS == 'centos' ]; then if [[ $GOODSETUP == '0' ]]; then
if [[ $GOODSETUP == '1' ]]; then whiptail_setup_complete
whiptail_setup_complete if [[ $THEHIVE == '1' ]]; then
if [[ $THEHIVE == '1' ]]; then check_hive_init_then_reboot
check_hive_init_then_reboot
else
shutdown -r now
fi
else else
whiptail_setup_failed
shutdown -r now shutdown -r now
fi fi
else else
if [[ $GOODSETUP == '0' ]]; then whiptail_setup_failed
whiptail_setup_complete shutdown -r now
if [[ $THEHIVE == '1' ]]; then
check_hive_init_then_reboot
else
shutdown -r now
fi
else
whiptail_setup_failed
shutdown -r now
fi
fi fi
fi fi