From e6155e6a864c9cc8d5710d889b008b57b0a706ee Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 17 Jul 2022 15:15:56 -0500 Subject: [PATCH] netwarn - with reboot question --- roles/network/tasks/install.yml | 2 +- scripts/netwarn.sh | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/roles/network/tasks/install.yml b/roles/network/tasks/install.yml index 301b3ddc0..592c1612c 100644 --- a/roles/network/tasks/install.yml +++ b/roles/network/tasks/install.yml @@ -80,7 +80,7 @@ file: src: "{{ iiab_dir }}/scripts/netwarn.sh" dest: /usr/local/sbin/netwarn - mode: '0755' + mode: 0755 state: link - name: Install /usr/bin/iiab-internet-on|off from template (root:root by default) diff --git a/scripts/netwarn.sh b/scripts/netwarn.sh index 8524c22f8..641d5ba81 100644 --- a/scripts/netwarn.sh +++ b/scripts/netwarn.sh @@ -1,8 +1,20 @@ +#!/bin/bash if ! [ -f /etc/iiab/install-flags/iiab-network-complete ]; then - zenity --question --text="You need to provision the network. Ensure you have your upstream internet active first if needed. You will be prompted for your password. You should REBOOT afterwards, do you want to Proceed?" + zenity --question --width=200 --text="You need to provision the network. Ensure you have your upstream internet active first. You might be prompted for your password. Should you not want to provision the network at this time just click NO" rc=$? if [ $rc == "1" ]; then - exit 1 + exit 0 fi x-terminal-emulator -e /usr/local/bin/iiab-network + rc=$? + if [ $rc == "1" ]; then + zenity --question --width=200 --text="Network exited with error, please review /opt/iiab/iiab/iiab-network.log" + exit 1 + fi + zenity --question --width=200 --text="A REBOOT is recommended, would you like to REBOOT now?" + rc=$? + if [ $rc == "1" ]; then + exit 0 + fi + x-terminal-emulator -e /usr/sbin/reboot fi