Change to sleep infinity & read and omit & wait on sleep n (e.g. not infinity)

This commit is contained in:
dougbtv
2021-02-09 15:14:06 -05:00
committed by Tomofumi Hayashi
parent e728da78bc
commit 8bbd3fdcf2

View File

@@ -257,7 +257,7 @@ if [ "$MULTUS_CONF_FILE" == "auto" ]; then
log "Attemping to find master plugin configuration, attempt $tries" log "Attemping to find master plugin configuration, attempt $tries"
fi fi
let "tries+=1" let "tries+=1"
sleep 1 & wait; sleep 1;
else else
error "Multus could not be configured: no master plugin was found." error "Multus could not be configured: no master plugin was found."
exit 1; exit 1;
@@ -401,22 +401,22 @@ if [ "$MULTUS_CLEANUP_CONFIG_ON_EXIT" == true ]; then
# Check and see if the original master plugin configuration exists... # Check and see if the original master plugin configuration exists...
if [ ! -f "$MASTER_PLUGIN_LOCATION" ]; then if [ ! -f "$MASTER_PLUGIN_LOCATION" ]; then
log "Master plugin @ $MASTER_PLUGIN_LOCATION has been deleted. Allowing 45 seconds for its restoration..." log "Master plugin @ $MASTER_PLUGIN_LOCATION has been deleted. Allowing 45 seconds for its restoration..."
sleep 10 & wait sleep 10
for i in {1..35} for i in {1..35}
do do
if [ -f "$MASTER_PLUGIN_LOCATION" ]; then if [ -f "$MASTER_PLUGIN_LOCATION" ]; then
log "Master plugin @ $MASTER_PLUGIN_LOCATION was restored. Regenerating given configuration." log "Master plugin @ $MASTER_PLUGIN_LOCATION was restored. Regenerating given configuration."
break break
fi fi
sleep 1 & wait sleep 1
done done
generateMultusConf generateMultusConf
log "Continuing watch loop after configuration regeneration..." log "Continuing watch loop after configuration regeneration..."
fi fi
sleep 1 & wait sleep 1
done done
else else
log "Entering sleep (success)..." log "Entering sleep (success)..."
sleep infinity & wait read
fi fi