Open WRT Script zu DDWRT möglich ?

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC basierende Hardware
Author Message
NoPublic
DD-WRT Novice


Joined: 15 Aug 2014
Posts: 1

PostPosted: Thu Aug 21, 2014 20:17    Post subject: Open WRT Script zu DDWRT möglich ? Reply with quote
Guten Tag ich habe einen WNR2200 DDWRT ich wollte ein cronjob für ein script nutzen von Open WRT da meiner DDWRT ist wollte ich fragen ob es möglich ist den für DDWRT zu nutzen oder umzuschreiben


#!/bin/sh
IP=8.8.4.4
LOG="/root/log_online.log"
LOG_FAIL="/root/log_offline.log"
HIDE_RUNS=false
DEV="tun314"

######################
# TUN device online? #
######################

for f in /var/run/openvpn-Hide*.pid
do

OPENVPN_PID=`cat $f`
#echo "PID war zuletzt $OPENVPN_PID."
[ -f /proc/$OPENVPN_PID/exe ] && HIDE_RUNS=true || echo "`date` - OpenVPN(Hide) is user-disabled. NOT restarting." > $LOG
done

if [ $HIDE_RUNS == true ]
then
ping -c 1 -I $DEV $IP > /dev/null
if [ $? == 0 ]
then
echo "`date` - OpenVPN(Hide) is up and I can ping through it." > $LOG
else
echo "`date` - OpenVPN(Hide) is up, but I CAN'T PING THROUGH IT. RESTARTING OPENVPN AND NETWORK." >> $LOG_FAIL
/etc/init.d/openvpn.luci stop
sleep 1
/etc/init.d/network restart
sleep 4
/etc/init.d/openvpn.luci start
sleep 15
/etc/init.d/openvpn.luci start
fi
fi


Vielen Dank
Sponsor
TeeZocker
DD-WRT Novice


Joined: 19 Feb 2012
Posts: 24

PostPosted: Tue Oct 14, 2014 14:10    Post subject: Reply with quote
sollte gehen aber müssen evt pakete nach installiert werden bzw. pfade bzw programmnamen geändert werden.

Zum probieren kannst du es als sh speichern und mal mit putty ausführen wenns durch läuft ok wenn nicht bekommste ne fehler meldung ^^
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Thu Oct 16, 2014 15:16    Post subject: Reply with quote
da wir weder luci nutzen noch /root schreibbar ist, ist 80% des script fuer die tonne. lieber ueberlegen was da passiert und die 2 zeilen selbst schreiben.
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC basierende Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum