summaryrefslogtreecommitdiff
path: root/noncore
authorwimpie <wimpie>2004-04-05 07:14:58 (UTC)
committer wimpie <wimpie>2004-04-05 07:14:58 (UTC)
commitc1bed3e1103b56236f77273cd586c1c3645702da (patch) (side-by-side diff)
tree23be835b56ba63150c926dbf8c80359578ec125a /noncore
parente6e31e93aa55bb967a044fe3660201000a6e59b0 (diff)
downloadopie-c1bed3e1103b56236f77273cd586c1c3645702da.zip
opie-c1bed3e1103b56236f77273cd586c1c3645702da.tar.gz
opie-c1bed3e1103b56236f77273cd586c1c3645702da.tar.bz2
forgot to store mac if needed
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/settings/networksettings2/setmacaddress.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/setmacaddress.sh b/noncore/settings/networksettings2/setmacaddress.sh
index f9abca2..10c6cc6 100755
--- a/noncore/settings/networksettings2/setmacaddress.sh
+++ b/noncore/settings/networksettings2/setmacaddress.sh
@@ -1,4 +1,17 @@
#!/bin/sh
+getmac() {
+ echo $5
+}
+
BDIR=/opt/QtPalmtop/etc/networktemplates
-[ ! -z "$1" -a -f ${BDIR}/$1.mac ] && ifconfig $1 hw ether `cat ${BDIR}/$1.mac`
+if [ -f ${BDIR}/$1.mac ]
+then
+# store
+ifconfig $1 hw ether `cat ${BDIR}/$1.mac`
+else
+# set
+mkdir -p $1
+i=`ifconfig $1 | grep -i hwaddr`
+getmac ${i} > ${BDIR}/$1.mac
+fi
exit 0