我在一个简单的脚本中运行aircrack-ng cmd
#! /bin/bash
clear
echo "enter router mac \n"
read mac
echo "enter path to word list \n "
read list
echo "enter path to file contain handshake \n"
read handshake
aircrack-ng -b $mac -w $list $handshake
当我按ctrl+c 脚本终止但aircrack-ng 仍在工作。
我知道这可能很简单,但我是新的。
答案1
当您按Ctrl+时C,您将向前台运行的作业发送一个信号(SIGINT)以被中断,这样的作业是脚本,而不是aircrack-ng
。
不过,您可以做的是控制脚本在收到 SIGINT 时的行为方式:
#! /bin/bash
trap "pkill aircrack-ng && exit" SIGINT SIGTERM
clear
echo "enter router mac \n"
read mac
echo "enter path to word list \n "
read list
echo "enter path to file contain handshake \n"
read handshake
aircrack-ng -b $mac -w $list $handshake