-
Notifications
You must be signed in to change notification settings - Fork 10
/
mac.sh
45 lines (42 loc) · 1.06 KB
/
mac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Dependencies
sudo dpkg -l | grep -qw net-tools || sudo apt install macchanger -y
# Menu
mainmenu() {
echo -ne "
1) Random mac
2) Custom mac
0) Exit
Choose an option: "
read -r ans
case $ans in
1)
# Ifconfig
ip link ls
# Ask for input
read -r -p "Enter interface name: " netinterface
sudo ip link set dev "$netinterface" down
sudo macchanger -r "$netinterface"
sudo ip link set dev "$netinterface" up
;;
2)
# Ifconfig
ip link ls
# Ask for input
read -r -p "Enter interface name: " netinterface
read -r -p "Enter custom mac (ex. b2:aa:0e:56:ed:f7) : " custom
sudo ip link set dev "$netinterface" down
sudo macchanger -m "$custom" "$netinterface"
sudo ip link set dev "$netinterface" up
;;
0)
echo "Bye bye."
exit 0
;;
*)
echo "Wrong option."
mainmenu
;;
esac
}
mainmenu