From 412ada5d6a7e05e4eb58c8a16a213919f262d28b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 22 Oct 2016 16:56:29 +0100 Subject: [PATCH] wait rather than nodown --- src/freedombone-image-customise | 2 +- src/freedombone-utils-wifi | 2 +- src/freedombone-wifi | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 44aa220a..4106f7ee 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -420,7 +420,7 @@ EOF echo " echo 'User=root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc echo " echo 'Group=root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc echo " echo 'WorkingDirectory=/root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc - echo " echo 'ExecStart=/usr/local/bin/freedombone-wifi --nodown y' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc + echo " echo 'ExecStart=/usr/local/bin/freedombone-wifi --wait 5 2> /dev/null' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc echo " echo '' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc echo " echo '[Install]' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc echo " echo 'WantedBy=multi-user.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc diff --git a/src/freedombone-utils-wifi b/src/freedombone-utils-wifi index 6723626c..7c019eba 100755 --- a/src/freedombone-utils-wifi +++ b/src/freedombone-utils-wifi @@ -562,7 +562,7 @@ function create_wifi_startup_script { echo 'User=root' >> $systemd_file echo 'Group=root' >> $systemd_file echo 'WorkingDirectory=/root' >> $systemd_file - echo "ExecStart=/usr/local/bin/${PROJECT_NAME}-wifi --nodown y" >> $systemd_file + echo "ExecStart=/usr/local/bin/${PROJECT_NAME}-wifi --wait 5 2> /dev/null" >> $systemd_file echo '' >> $systemd_file echo '[Install]' >> $systemd_file echo 'WantedBy=multi-user.target' >> $systemd_file diff --git a/src/freedombone-wifi b/src/freedombone-wifi index 505c5080..80b18176 100755 --- a/src/freedombone-wifi +++ b/src/freedombone-wifi @@ -46,7 +46,7 @@ WIFI_CONFIG=/etc/wpa_supplicant/wpa_supplicant.conf WIFI_NETWORKS_FILE=~/${PROJECT_NAME}-wifi.cfg NETWORKS_INTERACTIVE= WIFI_DISABLE= -NODOWN= +WAIT_SEC= IFACE= IFACE_SECONDARY= @@ -87,9 +87,9 @@ do wifi_interface_specified=1 write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE" ;; - --nodown) + --wait|--sleep|--pause) shift - NODOWN=1 + WAIT_SEC=${1} ;; -t|--type) shift @@ -138,11 +138,11 @@ if [ ${NETWORKS_INTERACTIVE} ]; then fi if [ ! ${wifi_interface_specified} ]; then - if [ ! $NODOWN ]; then + if [ ! $WAIT_SEC ]; then wpa_action ${WIFI_INTERFACE} stop wpa_cli -i ${WIFI_INTERFACE} terminate else - sleep 5 + sleep ${WAIT_SEC} fi update_wifi_adaptors if [ ! $IFACE ]; then