Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
disable_ipv6: more efficient audit_command
Browse files Browse the repository at this point in the history
Changed if else loop to a single if not check
  • Loading branch information
0xmachos committed Nov 5, 2019
1 parent 9cf9ade commit 8e15c37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lockdown
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ function disable_ipv6 {
title="Disable IPv6"

# shellcheck disable=SC2016
audit_command='while IFS= read -r i; do if networksetup -getinfo "${i}" | grep -q "IPv6: Off"; then :; else exit 1; fi; done <<< $(networksetup -listallnetworkservices | tail -n $(( $(networksetup -listallnetworkservices | wc -l) - 1 )))'
audit_command='while IFS= read -r i; do if ! networksetup -getinfo "${i}" | grep "IPv6: Off"; then echo "enabled"; fi; done <<< $(networksetup -listallnetworkservices | tail -n $(( $(networksetup -listallnetworkservices | wc -l) - 1 )))'
# shellcheck disable=SC2016
fix_command='while read -r i; do networksetup -setv6off "${i}"; done <<< "$(networksetup -listallnetworkservices | tail -n $(( $(networksetup -listallnetworkservices | wc -l) - 1 )))"'

Expand Down

0 comments on commit 8e15c37

Please sign in to comment.