Skip to content

Instantly share code, notes, and snippets.

@yunginnanet
Created September 10, 2024 04:40
Show Gist options
  • Save yunginnanet/84ec220615bbc08242c4c91f20f3e546 to your computer and use it in GitHub Desktop.
Save yunginnanet/84ec220615bbc08242c4c91f20f3e546 to your computer and use it in GitHub Desktop.
reset wireless interface for packet injection purposes to reset queues
#!/bin/bash
_target="$1"
if ! ip link show dev "$_target" >> /dev/null; then
echo "device $_target does not exist"; exit 1
fi
echo "resetting $_target"
ip link set down dev "$_target"
iw dev "$_target" set type managed
iw dev "$_target" set type monitor
ip link set up dev "$_target"
echo "fin."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment