Commits

Etienne Perot committed 33ffc44

Get rid of macchanger dependency

Comments (0)

Files changed (2)

 arch=('i686' 'x86_64')
 url='https://github.com/EtiennePerot/macchiato'
 license=('BSD')
-depends=('bash' 'macchanger-debian')
+depends=('bash' 'iproute2')
 makedepends=('git')
 
 _gitroot='git://perot.me/macchiato'
 devices=()
 for i in "$confDir"/*.sh; do
 	deviceName=$(basename "$i" | sed 's/\.sh$//')
-	if macchanger "$deviceName" &> /dev/null; then
+	if ip link show "$deviceName" &> /dev/null; then
 		devices+=("$deviceName")
 	else
 		echo "Configuration file '$i' found, but network interface '$deviceName' does not exist."
 			echo "[$device] Failed to bring device down! Assigning a new MAC address is likely to fail as well."
 		fi
 	fi
-	if ! macchanger -m "$finalMACAddress" "$device"; then
+	if ! ip link set "$device" address "$finalMACAddress"; then
 		echo "[$device] WARNING: Failed to assign MAC address '$finalMACAddress'"
 	fi
 	if [ -n "$deviceIsUp" ]; then