|
|
@ -261,7 +261,7 @@ check_deps(){ |
|
|
|
setopt shwordsplit |
|
|
|
setopt shwordsplit |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
for h in ${HARD_DEPS}; do |
|
|
|
for h in $(echo ${HARD_DEPS}); do |
|
|
|
_W=$(which ${h}) |
|
|
|
_W=$(which ${h}) |
|
|
|
if [ -z "${_W}" ]; then |
|
|
|
if [ -z "${_W}" ]; then |
|
|
|
echo "Error: required command \"${h}\" not found. Exiting..." |
|
|
|
echo "Error: required command \"${h}\" not found. Exiting..." |
|
|
@ -270,7 +270,7 @@ check_deps(){ |
|
|
|
log "check_deps" "NOTICE: required command '${h}'...found" |
|
|
|
log "check_deps" "NOTICE: required command '${h}'...found" |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
for s in ${SOFT_DEPS}; do |
|
|
|
for s in $(echo ${SOFT_DEPS}); do |
|
|
|
_S=$(which ${s}) |
|
|
|
_S=$(which ${s}) |
|
|
|
if [ -z "${_S}" ]; then |
|
|
|
if [ -z "${_S}" ]; then |
|
|
|
log "check_deps" "WARNING: suggested command '${s}' not found! Some functions might not work properly" |
|
|
|
log "check_deps" "WARNING: suggested command '${s}' not found! Some functions might not work properly" |
|
|
@ -278,7 +278,7 @@ check_deps(){ |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
HAS_OPTS="" |
|
|
|
HAS_OPTS="" |
|
|
|
for o in ${OPT_DEPS}; do |
|
|
|
for o in $(echo ${OPT_DEPS}); do |
|
|
|
_O=$(which ${o}) |
|
|
|
_O=$(which ${o}) |
|
|
|
if [ -n "${_O}" ]; then |
|
|
|
if [ -n "${_O}" ]; then |
|
|
|
HAS_OPTS=" ${HAS_OPTS} ${o} " |
|
|
|
HAS_OPTS=" ${HAS_OPTS} ${o} " |
|
|
@ -1615,7 +1615,7 @@ netdiag_routes(){ |
|
|
|
|
|
|
|
|
|
|
|
DUMPFILE=$1 |
|
|
|
DUMPFILE=$1 |
|
|
|
|
|
|
|
|
|
|
|
HAS_NETSTAT=$(echo ${HAS_OPTS} | grep -c " netstat ") |
|
|
|
HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") |
|
|
|
if [ ${HAS_NETSTAT} -ne 1 ]; then |
|
|
|
if [ ${HAS_NETSTAT} -ne 1 ]; then |
|
|
|
notfound "netstat" |
|
|
|
notfound "netstat" |
|
|
|
return |
|
|
|
return |
|
|
@ -1663,7 +1663,7 @@ netdiag_connections(){ |
|
|
|
DUMPFILE=$1 |
|
|
|
DUMPFILE=$1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HAS_NETSTAT=$(echo ${HAS_OPTS} | grep -c " netstat ") |
|
|
|
HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") |
|
|
|
if [ ${HAS_NETSTAT} -ne 1 ]; then |
|
|
|
if [ ${HAS_NETSTAT} -ne 1 ]; then |
|
|
|
notfound "netstat" |
|
|
|
notfound "netstat" |
|
|
|
return |
|
|
|
return |
|
|
@ -1692,7 +1692,7 @@ netdiag_services(){ |
|
|
|
|
|
|
|
|
|
|
|
DUMPFILE=$1 |
|
|
|
DUMPFILE=$1 |
|
|
|
|
|
|
|
|
|
|
|
HAS_NETSTAT=$(echo ${HAS_OPTS} | grep -c " netstat ") |
|
|
|
HAS_NETSTAT=$(echo "${HAS_OPTS}" | grep -c "\ netstat\ ") |
|
|
|
if [ ${HAS_NETSTAT} -ne 1 ]; then |
|
|
|
if [ ${HAS_NETSTAT} -ne 1 ]; then |
|
|
|
notfound "netstat" |
|
|
|
notfound "netstat" |
|
|
|
return |
|
|
|
return |
|
|
@ -1719,7 +1719,7 @@ netdiag_services(){ |
|
|
|
##function |
|
|
|
##function |
|
|
|
netdiag_ping(){ |
|
|
|
netdiag_ping(){ |
|
|
|
|
|
|
|
|
|
|
|
HAS_PING=$(echo ${HAS_OPTS} | grep -E -c "\ ping\ ") |
|
|
|
HAS_PING=$(echo "${HAS_OPTS}" | grep -E -c "\ ping\ ") |
|
|
|
if [ ${HAS_PING} -ne 1 ]; then |
|
|
|
if [ ${HAS_PING} -ne 1 ]; then |
|
|
|
notfound "ping" |
|
|
|
notfound "ping" |
|
|
|
return |
|
|
|
return |
|
|
@ -1746,7 +1746,7 @@ netdiag_ping(){ |
|
|
|
##function |
|
|
|
##function |
|
|
|
netdiag_traceroute(){ |
|
|
|
netdiag_traceroute(){ |
|
|
|
|
|
|
|
|
|
|
|
HAS_TRACERT=$(echo ${HAS_OPTS} | grep -c " traceroute ") |
|
|
|
HAS_TRACERT=$(echo "${HAS_OPTS}" | grep -c "\ traceroute\ ") |
|
|
|
if [ ${HAS_TRACERT} -ne 1 ]; then |
|
|
|
if [ ${HAS_TRACERT} -ne 1 ]; then |
|
|
|
notfound "traceroute" |
|
|
|
notfound "traceroute" |
|
|
|
return |
|
|
|
return |
|
|
@ -1773,8 +1773,8 @@ netdiag_traceroute(){ |
|
|
|
##function |
|
|
|
##function |
|
|
|
netdiag_lookup(){ |
|
|
|
netdiag_lookup(){ |
|
|
|
|
|
|
|
|
|
|
|
HAST_HOST=$(echo ${HAS_OPTS} | grep -c " host ") |
|
|
|
HAS_HOST=$(echo "${HAS_OPTS}" | grep -c "\ host\ ") |
|
|
|
if [ $? -ne 1 ]; then |
|
|
|
if [ ${HAS_HOST} -ne 1 ]; then |
|
|
|
notfound "host" |
|
|
|
notfound "host" |
|
|
|
return |
|
|
|
return |
|
|
|
fi |
|
|
|
fi |
|
|
|