Creazione automatica di un file di log per inviare quesiti al forum: differenze tra le versioni

Riga 365: Riga 365:
function _iwlist {
function _iwlist {
  local var="iwlist"
  local var="iwlist"
local tmpfile=$(/bin/tempfile)
  nome_e_riga "$var"
  nome_e_riga "$var"
  if [ -x /sbin/iwlist ]; then  
  if [ -x /sbin/iwlist ]; then  
  iwlist scan &>> $log && _ok "$var scan" || _error "$var scan"
    /sbin/iwlist scan > $tmpfile 2>&1
    if [ $? = 0 ]; then
      _ok "$var scan"  
      /bin/sed -e 's/ESSID:.*/ESSID:"*script-removed*"/g' -e '/^[ ]*IE: Unknown:.*/d' $tmpfile &>> $log
    else
      _error "$var scan"
    fi   
  else  
  else  
   echo "Il comando $var non esiste" >> $log && _error "$var"
   echo "Il comando $var non esiste" >> $log && _error "$var"
  fi
  fi
rm $tmpfile
}
}


86

contributi