wok-next diff ppp/receipt @ rev 15885
pppd: add /etc/ppp/ip-up.d & /etc/ppp/ip-down.d
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 08 13:29:05 2014 +0000 (2014-02-08) |
parents | 051931e905b0 |
children | 31599711e814 |
line diff
1.1 --- a/ppp/receipt Fri Dec 06 10:39:07 2013 +0000 1.2 +++ b/ppp/receipt Sat Feb 08 13:29:05 2014 +0000 1.3 @@ -44,7 +44,7 @@ 1.4 cp -a $install/usr/sbin $fs/usr 1.5 cp -a $install/usr/lib $fs/usr 1.6 # Config files. 1.7 - mkdir -p $fs/etc/ppp/scripts 1.8 + mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d 1.9 cp $stuff/README.scripts $fs/etc/ppp 1.10 cp -a $src/etc.ppp/* $fs/etc/ppp 1.11 1.12 @@ -57,7 +57,9 @@ 1.13 cp -a $src/scripts/callback $fs/etc/ppp/scripts 1.14 cp -a $src/scripts/redialer $fs/etc/ppp/scripts 1.15 cat >> $fs/etc/ppp/ip-up <<EOT 1.16 -if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then 1.17 +if [ -x /etc/ppp/ip-up.d/\$6 ]; then 1.18 + . /etc/ppp/ip-up.d/\$6 "\$@" 1.19 +elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then 1.20 rm -f /etc/ppp/resolv.prev 1.21 if [ -f /etc/resolv.conf ]; then 1.22 cp /etc/resolv.conf /etc/ppp/resolv.prev 1.23 @@ -72,7 +74,9 @@ 1.24 fi 1.25 EOT 1.26 cat >> $fs/etc/ppp/ip-down <<EOT 1.27 -if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then 1.28 +if [ -x /etc/ppp/ip-down.d/\$6 ]; then 1.29 + . /etc/ppp/ip-down.d/\$6 "\$@" 1.30 +elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then 1.31 if [ -f /etc/ppp/resolv.prev ]; then 1.32 cp -f /etc/ppp/resolv.prev /etc/resolv.conf 1.33 chmod 644 /etc/resolv.conf 1.34 @@ -83,7 +87,7 @@ 1.35 EOT 1.36 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up 1.37 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down 1.38 - chmod 711 $fs/etc/ppp/ip* 1.39 + chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down 1.40 1.41 # insert #!/bin/sh on top line in ip* scripts 1.42 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip*