diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-12-14 17:57:12 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-12-14 17:57:12 +0000 |
commit | ac0c7a5c96b015af2abd74d3c9f24f51c198abfd (patch) | |
tree | 69c79a4838066dd362f9cfb196f48e8272e856fa /rc/bin | |
parent | f8509c37cb6717a18937cfe8e2f19355b090c0d0 (diff) |
netaudit: fix it for multiple results
Diffstat (limited to 'rc/bin')
-rwxr-xr-x | rc/bin/netaudit | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/rc/bin/netaudit b/rc/bin/netaudit index af55f3020..df84c481b 100755 --- a/rc/bin/netaudit +++ b/rc/bin/netaudit @@ -164,22 +164,19 @@ fn checkauth { } fn checksec { echo 'checking basic security:' - fs=`{ndb/ipquery sys $sysname fs | sed 's/fs=//g'} - if(~ $fs '') - echo ' we do not seem to be netbooting' - if not @{ + for(fs in `{ndb/ipquery sys $sysname fs | sed 's/fs=//g'}) @{ rfork n - </srv/clone { - bind -c /srv/^`{read} /srv - if(srv $fs netaudit.$pid >/dev/null >[2=1] || srvtls $fs netaudit.$pid >/dev/null >[2=1]){ - if(mount -n /srv/netaudit.$pid /n/netaudit >/dev/null >[2=1]) - echo ' file server does not require auth for user '^$user - if not - echo ' file server seems to require auth' - } + + echo $fs + if(srv $fs netaudit.$pid >[2] /dev/null || srvtls $fs netaudit.$pid >[2] /dev/null){ + if(mount -n /srv/netaudit.$pid /n/netaudit >/dev/null >[2=1]) + echo ' file server does not require auth for user '^$user if not - echo ' '^$fs^' is not listening' + echo ' file server seems to require auth' } + if not + echo ' '^$fs^' is not listening' + rm -f /srv/netaudit.$pid } } checkhost |