openwifi/user_space/nic_back_to_normal.sh

24 lines
440 B
Bash
Raw Normal View History

2019-12-10 13:03:47 +00:00
#!/bin/bash
2021-02-03 14:54:04 +00:00
# Author: Xianjun Jiao
# SPDX-FileCopyrightText: 2019 UGent
2021-01-20 12:30:12 +00:00
# SPDX-License-Identifier: AGPL-3.0-or-later
2019-12-10 13:03:47 +00:00
if [ $# -ne 1 ]
then
echo "Please input NIC name as input parameter!"
exit
fi
nic_name=$1
echo $nic_name
# sudo service network-manager stop
sudo ip link set $nic_name down
sudo iwconfig $nic_name mode managed
#sudo iwconfig $nic_name modulation 11g
sudo ip link set $nic_name up
ifconfig
iwconfig $nic_name