What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

pptpd.postconf not working ??? (380.61)

residend

New Around Here
Hello.

pptpd.postconf script do not working for me. If i start this script manually all ok, but if it start automatically files pptpd.conf, ip-up or ip-down dosen't modifed. How can i fix it?

pptpd.postconf :
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh
pc_insert "if [ \"\$PEERNAME\" = \"rk1\" ]; then" "iptables -D INPUT -i \$1 -j ACCEPT; iptables -I INPUT -s 192.168.111.6 -j ACCEPT" /tmp/pptpd/ip-up
pc_insert "if [ \"\$PEERNAME\" = \"rk1\" ]; then" "iptables -D FORWARD -i \$1 -j ACCEPT; iptables -I FORWARD 2 -s 192.168.111.6 -j ACCEPT" /tmp/pptpd/ip-up
pc_append "if [ \"\$PEERNAME\" = \"rk1\" ]; then; iptables -D INPUT -s 192.168.111.6 -j ACCEPT; iptables -D FORWARD -s 192.168.111.6 -j ACCEPT; fi" /tmp/pptpd/ip-down

log:
Code:
Sep  6 00:05:58 custom script: Running /jffs/scripts/pptpd.postconf (args: /tmp/pptpd/pptpd.conf)
Sep  6 00:05:58 pptpd[1772]: MGR: Config file not found!
 
Can anybody help me?

As we are not actually updating pptpd.conf (i.e. it's one of the other PPTPD associated files that are created later), I delay executing the modifications to the ip-up file so I manually execute pptpd.postconf from init-start.

NOTE:
I could obviously remove the statements from pptpd.postconf, but it acts as a 'visual' reminder that I am altering the PPTP Server feature! ;-)

Code:
#!/bin/sh

HARDWARE_MODEL=$(nvram get productid)
MYROUTER=$(nvram get computer_name)
BUILDNO=$(nvram get buildno)
EXTENDNO=$(nvram get extendno)

/usr/bin/logger -s -t "($(basename $0))" $$ "Martineau $MYROUTER BOOT in progress... [$@]"

# NOTE: Can't use Flash drive /tmp/mnt/$MYROUTER/ 'cos it hasn't been mounted yet :-(
# 'flock' is probably a better solution rather than the 'echo'  ;-)
echo $$"-"`date` > /tmp/BOOTINPROGRESS # PID will allow other scripts to identify locke


<snip: do the extra stuff to set up my environment i.e. create cron jobs etc.>



# Should be sufficient to cover physical BOOT process?
sleep 180

# This script appears to be executed too early? so manually run it here....
/jffs/scripts/pptpd.postconf

# May 2015 Auto fix debug random SSH server failure..
/jffs/scripts/MonitorSSH.sh

# Move Syslog to USB Flash drive
/jffs/scripts/syslog-move.sh

rm /tmp/BOOTINPROGRESS

/usr/bin/logger -s -t "($(basename $0))" $$ "Martineau $MYROUTER BOOT Completed Firmware build" $BUILDNO $EXTENDNO "[$@]"

resulting in the following in syslog during the router boot......

Code:
Aug 17 08:19:33 (init-start): 341 LEDs ON scheduled 06:00
Aug 17 08:19:33 (init-start): 341 LEDs OFF scheduled 18:00
Aug 17 08:19:34 (init-start): 341 Track RT-AC68U Session UPTIME scheduled every hour.....
Aug 17 08:19:34 (pptpd.postconf): 1724 Post-conf Starting ..... []
Aug 17 08:19:34 (pptpd.postconf): 1724 Modifying PPTP /tmp/pptpd/ip-up script.....
Aug 17 08:19:34 (pptpd.postconf): 1724 Post-conf complete .....
Aug 17 08:19:34 (syslog-move.sh): 1734 SYSLOG Housekeeping Running...... Wed Aug 17 08:19:34 DST 2016 []
 
Last edited:
As we are not actually updating pptpd.conf (i.e. it's one of the other PPTPD associated files that are created later), I delay executing the modifications to the ip-up file so I manually execute pptpd.postconf from init-start.

NOTE:
I could obviously remove the statements from pptpd.postconf, but it acts as a 'visual' reminder that I am altering the PPTP Server feature! ;-)

Thanks, you helped me!

i did it like this:

pptpd.conf:
Code:
#!/bin/sh
/jffs/scripts/ipupmod.sh &
& - executes the command in the background in a subshell

and i'm created script "ipupmod.sh":
Code:
#!/bin/sh
sleep 10
source /usr/sbin/helper.sh
pc_insert "if [ \"\$PEERNAME\" = \"rk1\" ]; then" "iptables -D INPUT -i \$1 -j
pc_insert "if [ \"\$PEERNAME\" = \"rk1\" ]; then" "iptables -D FORWARD -i \$1
pc_append "if [ \"\$PEERNAME\" = \"rk1\" ]; then; iptables -D INPUT -s 192.168

This working well, without init-start script.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top