Data
Mitglied
- Mitglied seit
- 1 Aug 2004
- Beiträge
- 251
- Punkte für Reaktionen
- 0
- Punkte
- 0
debug.cfg
Beim px ax mach ich offenbar noch was falsch:
@hiro
DNS hab ich schon ausgeschlossen, da ich mit IP zur Box stoße. Oder versteh ich da was falsch?
Code:
# cat /var/flash/debug.cfg
#!/bin/sh
# start telnet deamon with password of web gui
/usr/sbin/telnetd -l /sbin/ar7login
# enable international settings
sed "s/avme/avm/g" /usr/www/all/html/de/fon/sip1.html > /var/tmp/sip1.html
sed "s/avme/avm/g" /usr/www/all/html/de/fon/sip1.js > /var/tmp/sip1.js
chmod 444 /var/tmp/sip1.html
chmod 444 /var/tmp/sip1.js
mount -o bind /var/tmp/sip1.html /usr/www/all/html/de/fon/sip1.html
mount -o bind /var/tmp/sip1.js /usr/www/all/html/de/fon/sip1.js
# enable ENUM
sed "s/avme/avm/g" /usr/www/all/html/de/fon/sipoptionen.html > /var/tmp/sipoptionen.html
sed "s/avme/avm/g" /usr/www/all/html/de/fon/sipoptionen.js > /var/tmp/sipoptionen.js
chmod 444 /var/tmp/sipoptionen.html
chmod 444 /var/tmp/sipoptionen.js
mount -o bind /var/tmp/sipoptionen.html /usr/www/all/html/de/fon/sipoptionen.html
mount -o bind /var/tmp/sipoptionen.js /usr/www/all/html/de/fon/sipoptionen.js
# show wlan status
# write WLAN-Check script to file
cat > /var/tmp/WLAN-Check << 'ENDWLANCHECK'
#!/bin/sh
case `echo wlancfg.ap_enabled | wlancfgctl -s` in
0)
echo 19,1 > /var/led
;;
1)
echo 19,2 > /var/led
;;
*)
echo 19,3 > /var/led
;;
esac
ENDWLANCHECK
# write WLAN-Check-Deamon script to file
cat > /var/tmp/WLAN-Check-Deamon << 'ENDWLANCHECKDEAMON'
#!/bin/sh
while [ 1 ]
do
/var/tmp/WLAN-Check
sleep 60
done
ENDWLANCHECKDEAMON
# make them executable
chmod +x /var/tmp/WLAN-Check
chmod +x /var/tmp/WLAN-Check-Deamon
# execute WLAN-Check-Deamon
sleep 5
/var/tmp/WLAN-Check-Deamon &
# write lines list
echo ":anonym;
9016176:ISDN;" > /var/tmp/lines
# write reverse lookup script to file
cat > /var/tmp/invers.sh << 'ENDINVERS'
#!/bin/sh
number=$1
prefix=$2
wget -q -O /var/tmp/name "http://www.dasoertliche.de/DB4Web/es/oetb2suche/home.htm?kw_invers=${number}&main=Antwort&s=2" 2>/dev/null
while read reverse
do
case ${reverse} in
*Detailansicht*)
name=${reverse#*\>\ }
name=${name%%\<*}
break
;;
esac
done < /var/tmp/name
rm /var/tmp/name
echo `echo "${name}" | sed -e '{s/Ä/Ae/g;s/Ö/Oe/g;s/Ü/Ue/g;s/ä/ae/g;s/ö/oe/g;s/ü/ue/g;s/ß/ss/g;}'`
ENDINVERS
# make it executable
chmod +x /var/tmp/invers.sh
# write send script to file
cat > /var/tmp/send.sh << 'ENDSEND'
#!/bin/sh
# init var name
name=""
# read params
caller=$2
called=$1
#read contact list
while read contact
do
case ${contact} in
${caller}*)
name=${contact#*:}
name=${name%%\;*}
break
;;
esac
done < /var/tmp/contacts
# name not found?
if [ -z "${name}" ]
then
# do reverse lookup for at www.dasoertliche.de
name=`/var/tmp/invers.sh ${caller} ${prefix}`
# found name?
if [ -n "${name}" ]
then
# add found contact to contacts and debug.cfg
echo "${caller}:${name};" >> /var/tmp/contacts
cat /var/flash/debug.cfg | sed -e "s/\" > \/var\/tmp\/contacts/
${caller}:${name};\" > \/var\/tmp\/contacts/g" > /var/tmp/debug.cfg
else
# add anonymous for contact to contacts and debug.cfg
echo "${caller}:${caller};" >> /var/tmp/contacts
cat /var/flash/debug.cfg | sed -e "s/\" > \/var\/tmp\/contacts/
${caller}:${caller};\" > \/var\/tmp\/contacts/g" > /var/tmp/debug.cfg
fi
cat /var/tmp/debug.cfg > /var/flash/debug.cfg
rm /var/tmp/debug.cfg
fi
# name not found?
if [ -z "${name}" ]
then
name=${caller}
fi
httpname=`echo "${name}" | sed -e 's/ /%20/g'`
#init var theline
theline=""
#read lines list
while read thelines
do
case ${thelines} in
${called}*)
theline=${thelines#*:}
theline=${theline%%\;*}
break
;;
esac
done < /var/tmp/lines
# line not found?
if [ -z "${theline}" ]
then
theline=${called}
fi
httptheline=`echo "${theline}" | sed -e 's/ /%20/g'`
# Send information to all DHCP clients
while read x x IP x
do
wget -O /dev/null "http://${IP}:23232/?caller=${caller}&called=${called}&name=${name}&line=${theline}" >/dev/null 2>&1 &
done < /var/flash/multid.leases
# send information to PCs
wget -O /dev/null "http://192.168.178.23:23232/?caller=${caller}&called=${called}&name=${name}&line=${theline}" >/dev/null 2>&1 &
# send information to DBoxes -> TV screen
wget -O /dev/null "http://root:[email protected]/control/message?popup=Eingehender%20Anruf%0AAnrufer:%20${httpname}%0ALeitung:%20${httptheline}" >/dev/null 2>&1 &
# send information to DBoxes -> LCD
wget -O /dev/null "http://root:[email protected]/control/lcd?lock=1&clear=1&xpos=5&ypos=20&size=18&font=2&text=${httpname}&update=1" >/dev/null 2>&1 &
wget -O /dev/null "http://root:[email protected]/control/lcd?lock=1&clear=0&xpos=5&ypos=45&size=18&font=2&text=an%20${httptheline}&update=1" >/dev/null 2>&1 &
sleep 10
wget -O /dev/null "http://root:[email protected]/control/lcd?lock=0" >/dev/null 2>&1 &
ENDSEND
# make it executable
chmod +x /var/tmp/send.sh
# write callmessage script to file
cat > /var/tmp/callmessage.sh << 'ENDCALLMESSAGE'
#!/bin/sh
prefix=0951
caller=""
called=""
# stdin: output of telefon daemon expected
while read line
do
echo ${line}
case ${line} in
IncomingCall:*)
caller=${line#*caller: \"}
caller=${caller%%\"*}
called=${line#*called: \"}
called=${called%%\"*}
# normalize caller
case ${caller} in
0049*)
caller=0${caller#*0049}
;;
49????????*)
caller=0${caller#*49}
;;
[1-9]*)
caller=${prefix}${caller}
;;
esac
/var/tmp/send.sh ${called} ${caller} &
;;
esac
done
ENDCALLMESSAGE
# make it executable
chmod +x /var/tmp/callmessage.sh
# wait
sleep 3
# restart telefon daemon piping its output into callmessage.sh
if [ -x /var/tmp/callmessage.sh ]
then
# stop telefon daemon safely
killall -15 telefon
sleep 3
killall -9 telefon
rm -f /var/run/telefon.pid
sleep 3
telefon -a127.0.0.1 | /var/tmp/callmessage.sh &
fi
# load SSH-Server (dropbear) and etherwake
# CONFIGURATION
# SSH
# port
dropbearport="22"
# password
PASSWD='$1$Zj2.uO2.$Vopl2POkmBwWVTB9MCe7M.'
# Etherwake
# MAC address
wolmac="00:11:2F:E8:5F:53"
# interface to use for WOL
# intf = std - ata
# eth0 = LAN1 - WAN
# eth1 = LAN2 - LAN1
wolinterface="eth0"
# CONFIGURATION END
# change root password
cp -p /var/tmp/shadow /var/tmp/shadow.old
sed -e "/root:/s#^root:[^:]*:#root:${PASSWD}:#" /var/tmp/shadow.old > /var/tmp/shadow
# wait for server
while !(ping -c 1 www.xxxxxx.de)
do
sleep 5
done
# change dir
cd /var/tmp
# create simplified WOL script
echo "/var/tmp/etherwake -i ${wolinterface} ${wolmac}" > ./startpc
# load files
wget http://www.xxxxxx.de/daten/dropbear
wget http://www.xxxxxx.de/daten/busybox
# make them executable
chmod +x /var/tmp/dropbear
chmod +x /var/tmp/busybox
chmod +x /var/tmp/startpc
# create symlink for dropbearkey
ln -s /var/tmp/dropbear dropbearkey
ln -s /var/tmp/busybox etherwake
ln -s /var/tmp/busybox uudecode
ln -s /var/tmp/busybox uuencode
# make FBF accessable from the internet (192.168.178.253)
sleep 60
ifconfig eth0:0 192.168.178.253 netmask 255.255.255.0 broadcast 192.168.178.255 up
# dropbear hostkeys
/var/tmp/uudecode -o /var/tmp/dropbear_rsa_host_key << 'EOP'
begin 600 /var/tmp/dropbear_rsa_host_key
M````!W-S:"UR<V$````#`0`!````@P"X=EPR0$X3)-:4^'ZF:D/67O(<;;(0
MHI*T;.#*PBT0F(]BK>`S+/"OV8H\0!C]TE"*S4#X_(?WET-6<G?)`T%?LOQ[
MR.UF!:#)-)Z)4-X/&0>'17)XG?<S[9>F@&72OU]X9#%*J6=S7F;9<W+4@'.Z
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J+LMZ@Z\````5`/PC`V08"-<E:K3/
)A`EA0]]+=W90
`
end
EOP
# start dropbear
sleep 3
/var/tmp/dropbear -p ${dropbearport} -r /var/tmp/dropbear_rsa_host_key -d /var/tmp/dropbear_dss_host_key
#
Beim px ax mach ich offenbar noch was falsch:
Code:
# cat /var/flash/ps ax
cat: /var/flash/ps: No such file or directory
cat: ax: No such file or directory
@hiro
DNS hab ich schon ausgeschlossen, da ich mit IP zur Box stoße. Oder versteh ich da was falsch?