Viktor Jaep
Part of the Furniture
Thanks for another go at this, @SomeWhereOverTheRainBow... Your first bit of code yielded similar results. Everything is mostly blank, with a few exceptions where it was able to squeeze an nvram call in there:maybe the CPU timing is wrong.. Something is seriously wrong if it cannot get past that.
try this?
Code:#!/bin/sh trap '' HUP INT QUIT ABRT TERM (i="0" while true; do i="$(( i + 1 ))"; for nv in 1 2 3 4 5; do unset "state${nv}"; [ "$(ps -T | grep "nvram get" | wc -l )" -le "2" ] && eval "state${nv}"="$(/bin/nvram get vpn_client${nv}_state)"; done clear echo "$state1" "$state2" "$state3" "$state4" "$state5" echo "$i" done) > /tmp/mynvramerror.log 2>&1 & exit 0
or
Code:#!/bin/sh trap '' HUP INT QUIT ABRT TERM (i="0" until [ "$(ps -T | grep "nvram get" | wc -l )" -gt "2" ]; do i="$(( i + 1 ))"; for nv in 1 2 3 4 5; do unset "state${nv}"; [ "$(ps -T | grep "nvram get" | wc -l )" -le "2" ] && eval "state${nv}"="$(/bin/nvram get vpn_client${nv}_state)"; done clear echo "$state1" "$state2" "$state3" "$state4" "$state5" echo "$i" done) > /tmp/mynvramerror.log 2>&1 & exit 0
The second bit of code seemed to quit right after it ran, and the log file was blank.