Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! bin/bash
- # Randomises your wlan0 MAC address on system startup
- # on Ubuntu\Debian platforms - Must be run as root.
- # Warning: Do not use if you assign static IP routing.
- # Kind Regards,
- # 264nm
- isRoot() {
- # Check if the current user is root or not !
- if [ $EUID = 0 ]; then
- return 0
- else
- return 1
- fi
- }
- yesRoot() {
- #Creates init.d file
- touch /etc/init.d/macchangerstartup
- #Checks for macchanger package and installs
- echo "Root confirmed"
- sudo apt-get -y install macchanger
- echo "Creating startup script"
- echo "
- #! bin/sh
- ifconfig wlan0 down
- #ifconfig wlan1 down
- #ifconfig eth0 down
- #ifconfig eth1 down
- macchanger -r wlan0
- #macchanger -r wlan1
- #macchanger -r eth0
- #macchanger -r eth1
- ifconfig wlan0 up
- #ifconfig wlan1 up
- #ifconfig eth0 up
- #ifconfig eth1 up
- " > /etc/init.d/macchangerstartup
- chmod 755 /etc/init.d/macchangerstartup
- chmod +x /etc/init.d/macchangerstartup
- update-rc.d macchangerstartup defaults
- sleep 5
- echo "Process Complete... Confirm functionality
- and compare MAC address by rebooting."
- }
- if [ isRoot = 0 ]; then
- exit
- else yesRoot
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement