Skip to content

Commit

Permalink
airmon-ng.linux: protect mountpoint call with a check
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroChaos- committed Dec 22, 2023
1 parent 15c1810 commit dbce926
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/airmon-ng.linux
Expand Up @@ -12,11 +12,13 @@ if [ ! -d '/sys/' ]; then
printf "CONFIG_SYSFS is disabled in your kernel, this program will not work.\n"
exit 1
fi
if ! mountpoint -q -- /sys; then
printf "/sys is not mounted, you can probably mount it with:\n"
printf "mount -t sysfs sysfs /sys\n"
printf "This program cannot continue without a working sysfs.\n"
exit 1
if [ -x "$(command -v mountpoint 2>&1)" ]; then
if ! mountpoint -q -- /sys > /dev/null; then
printf "/sys is not mounted, you can probably mount it with:\n"
printf "mount -t sysfs sysfs /sys\n"
printf "This program cannot continue without a working sysfs.\n"
exit 1
fi
fi
if [ ! -d '/sys/class' ]; then
printf "This program cannot continue without a working sysfs.\n"
Expand Down

0 comments on commit dbce926

Please sign in to comment.