version 1.159, 2015/11/01 15:37:18 |
version 1.160, 2015/11/12 22:50:46 |
|
|
# Turn off Strict Bourne shell mode. |
# Turn off Strict Bourne shell mode. |
set +o sh |
set +o sh |
|
|
# Strip comments (and leading/trailing whitespace if IFS is set) from a file |
# Strip comment lines from a file. |
# and spew to stdout. |
# Strip leading and trailing whitespace if IFS is set. |
|
# Usage: stripcom /path/to/file |
stripcom() { |
stripcom() { |
local _l |
local _file=$1 _line |
[[ -f $1 ]] || return |
|
while read _l; do |
[[ -f $_file ]] || return |
[[ -n ${_l%%#*} ]] && echo $_l |
|
done<$1 |
while read _line; do |
|
[[ -n ${_line%%#*} ]] && print -r -- "$_line" |
|
done <$_file |
} |
} |
|
|
# Start the $1 interface. |
# Start a single interface. |
|
# Usage: ifstart if1 |
ifstart() { |
ifstart() { |
if=$1 |
if=$1 |
# Interface names must be alphanumeric only. We check to avoid |
# Interface names must be alphanumeric only. We check to avoid |