fritsp1989
Regular Contributor
Thanks for the effort you put in this project merlin.
I have a little question about the wake on lan funtions on the firmware you provide.
The webgui works exellent at this moment but it gives me to much hassle because everytime i want to visit my personal pages i need to login.
As for friends and family this is a problem because i do not provide logins to the router for them simply because i am afraid they wil screw it up.
After a long time searching on how to do it i found a couple of solutions.
1. Leave my server on for 24hs a day ( Thats gonna cost me 275 euro on yearly bases.
2. Turn on Wake On Magic Pattern , but that gives me the problem that my server doesnt mind wich port is being used and keeps on booting.
So that was not an option....
And then i found a script.
It was written for DD-WRT but i think there has to me a solution to make it work on merlin firmware.
#!/bin/sh
#Enable JFFS2 and place script in /jffs/ then run on startup in web interface.
#You can check the log from http://192.168.1.1/user/wol.html
INTERVAL=5
NUMP=3
OLD=""
PORT=80
WOLPORT=9
TARGET=192.168.1.101
BROADCAST=192.168.1.255
MAC=00:11:22:33:44:55
WOL=/usr/sbin/wol
LOGFILE="/tmp/www/wol.html"
echo "<meta http-equiv=\"refresh\" content=\"10\">" > $LOGFILE
echo "AUTO WOL Script started at" `date` "<br>" >> $LOGFILE
while sleep $INTERVAL;do
NEW=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1`
SRC=`dmesg | awk -F'[=| ]' '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print $7}' | tail -1`
LINE=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/'`
if [ "$NEW" != "" -a "$NEW" != "$OLD" ]; then
if ping -qc $NUMP $TARGET >/dev/null; then
echo "NOWAKE $TARGET was accessed by $SRC and is already alive at" `date` "<br>">> $LOGFILE
else
echo "WAKE $SRC causes wake on lan at" `date` "<br>">> $LOGFILE
$WOL -i $BROADCAST -p $WOLPORT $MAC >> $LOGFILE
echo "<br>" >> $LOGFILE
sleep 5
fi
OLD=$NEW
fi
done
But how do i make this script working on Merlin WRT
I have a little question about the wake on lan funtions on the firmware you provide.
The webgui works exellent at this moment but it gives me to much hassle because everytime i want to visit my personal pages i need to login.
As for friends and family this is a problem because i do not provide logins to the router for them simply because i am afraid they wil screw it up.
After a long time searching on how to do it i found a couple of solutions.
1. Leave my server on for 24hs a day ( Thats gonna cost me 275 euro on yearly bases.
2. Turn on Wake On Magic Pattern , but that gives me the problem that my server doesnt mind wich port is being used and keeps on booting.
So that was not an option....
And then i found a script.
It was written for DD-WRT but i think there has to me a solution to make it work on merlin firmware.
#!/bin/sh
#Enable JFFS2 and place script in /jffs/ then run on startup in web interface.
#You can check the log from http://192.168.1.1/user/wol.html
INTERVAL=5
NUMP=3
OLD=""
PORT=80
WOLPORT=9
TARGET=192.168.1.101
BROADCAST=192.168.1.255
MAC=00:11:22:33:44:55
WOL=/usr/sbin/wol
LOGFILE="/tmp/www/wol.html"
echo "<meta http-equiv=\"refresh\" content=\"10\">" > $LOGFILE
echo "AUTO WOL Script started at" `date` "<br>" >> $LOGFILE
while sleep $INTERVAL;do
NEW=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1`
SRC=`dmesg | awk -F'[=| ]' '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print $7}' | tail -1`
LINE=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/'`
if [ "$NEW" != "" -a "$NEW" != "$OLD" ]; then
if ping -qc $NUMP $TARGET >/dev/null; then
echo "NOWAKE $TARGET was accessed by $SRC and is already alive at" `date` "<br>">> $LOGFILE
else
echo "WAKE $SRC causes wake on lan at" `date` "<br>">> $LOGFILE
$WOL -i $BROADCAST -p $WOLPORT $MAC >> $LOGFILE
echo "<br>" >> $LOGFILE
sleep 5
fi
OLD=$NEW
fi
done
But how do i make this script working on Merlin WRT