summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/setmacaddress.sh
blob: 10c6cc6c0877926d2c12cbcb1297b643476b32e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
getmac() {
  echo $5
}

BDIR=/opt/QtPalmtop/etc/networktemplates
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