Maybe someone here with some Android Bourne Shell scripting know how can help me
I have this script which will change MAC address on the fly but i cant seem to check if file exist when using if then else statements
here is a simple check if exist script call but it wont echo what i want
===========
#!/bin/bash
if [ -e "/data/misc/wifi/nvram.bak" ];
then echo "!@#";
fi;
echo "1111"
==========
AND HERE IS MY MAC CHANGE SCRIPT WHICH WORKS
i just want to see if the bak file exist or not so i dont overwrite the bak with the fake
ran it like so:
copy the .sh script to sdcard
copy it to /data/local
while in the sdcard directory run it with
sh /data/local/test.sh OR you can sh test.sh with the file in sdcard (either way)
which works fine except the check exist conundrum
===========
#!/bin/bash
echo "Enter Fake MacAddress:"
read macx;
echo "# Motorola Ciena B2B Test nvram by BRCM JP, 2010.07.15
# $Copyright (C) 2008 Broadcom Corporation$
# $id$
sromrev=3
vendid=0x14e4
devid=0x432f
boardtype=0x569
boardrev=0x32
boardflags=0x200
# Specify the xtalfreq if it is otherthan 38.4MHz
xtalfreq=38400
aa2g=1
aa5g=0
ag0=255
# 11g paparams
pa0b0=0x1695,0x1695,0x1542
pa0b1=0xFB50,0xFB50,0xFBF8
pa0b2=0xFF3E,0xFF3E,0xFF8C
pa0itssit=62
pa0maxpwr=69
ofdmpo=0x66666668
cckpo=0x2222
mcs2gpo0=0x8888
mcs2gpo1=0x8888
# 11g rssi params
rssismf2g=0xa,0xa,0xa
rssismc2g=0xb,0xb,0xb
rssisav2g=0x3,0x3,0x3
bxa2g=0
# country code
ccode=ALL
cctl=0x0
cckdigfilttype=1
ofdmdigfilttype=1
rxpo2g=0
boardnum=1
# xtal pu and pd time control variable
# pu time is driver default (0x1501)
#r13t=0x1501
#######
nocrc=1
#for mfgc
otpimagesize=182
# sdio extra configs
hwhdr=0x05ffff031030031003100000
#This generates empty F1, F2 and F3 tuple chains, and may be used if the host SDIO stack does not require the standard tuples.
#RAW1=80 02 fe ff
#This includes the standard FUNCID and FUNCE tuples in the F1, F2, F3 and common CIS.
RAW1=80 32 fe 21 02 0c 00 22 2a 01 01 00 00 c5 0 e6 00 00 00 00 00 40 00 00 ff ff 80 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 20 04 D0 2 29 43 21 02 0c 00 22 04 00 20 00 5A
### !!! W A R N I N G !!! ###
### Please do not add anything after this line.
### "macaddr" should be the last item(line) in this file.
macaddr=$macx" > nvram.txt;
cp nvram.txt /data/local;
rm nvram.txt;
cp /data/misc/wifi/nvram.txt /data/misc/wifi/nvram.bak;
rm /data/misc/wifi/nvram.txt;
mv /data/local/nvram.txt /data/misc/wifi;
chmod 755 /data/misc/wifi/nvram.txt;
===========
|