1

I'm trying to run the airodum-ng command for 5 seconds then stop it and save the output to the network variable, so I can print the output to a whiptail gui. Unfortunately the command just never stops running does anyone know how to fix this. I tried the timeout method witch you can see here and i also tried to use sleep but no luck.

function aircrack() {
  sudo airmon-ng check kill
  name=($(sudo /usr/sbin/airmon-ng ))
  sudo airmon-ng start ${name[5]}
  name=($(sudo /usr/sbin/airmon-ng ))
  **netwroks=($(timeout 5s sudo airodump-ng ${name[5]}))**
}
lcheylus
  • 1,217
  • 8
  • 21
Nate-ar
  • 13
  • 5

1 Answers1

0

In your code, the non-root timeout tries to kill a root process and fails. The correct way to use timeout with sudo would be:

sudo timeout 5s airodump-ng ${name[5]}
Alex Biba
  • 63
  • 5