aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-03-17 21:41:22 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-03-17 21:41:22 +0100
commitc58cc7d3796dcee6e93885c835ed04cb566abeb2 (patch)
tree3eea4d4ef6a4ef79e0f4e025d7012c1a5cc38835 /meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh
parenteec6ab97f712e06eb52c9f7c99e19ffab3ce9d74 (diff)
downloadmeta-openembedded-contrib-c58cc7d3796dcee6e93885c835ed04cb566abeb2.tar.gz
move layer into meta-oe in preparation for future splits
As per TSC decision Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh')
-rw-r--r--meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh b/meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh
new file mode 100644
index 0000000000..c0b8251ae9
--- /dev/null
+++ b/meta-oe/recipes-core/udev/udev/nokia900/nokia-n900-mac-hack.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+if [ $# -ne 2 ]; then
+ echo "Usage: $0 iface newmac"
+ echo " newmac is only saved if /etc/<iface>MAC is not found"
+ exit 1
+fi
+
+iface="$1"
+newmac="$2"
+macfile=/etc/"$iface"mac
+
+# If no MAC is found, save the one given as argument
+if [ ! -e $macfile ]; then
+ /bin/echo "$newmac" > $macfile
+# Otherwise load MAC from file
+else
+ newmac=`/bin/cat $macfile`
+fi
+
+# Configure interface
+/sbin/ifconfig "$iface" down
+/sbin/ifconfig "$iface" hw ether $newmac