wok-6.x diff ppp/receipt @ rev 23351
Up slitaz-icons-paper (1.5.0)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Mar 31 10:49:33 2020 +0200 (2020-03-31) |
parents | 1035f0e819bc |
children | a8546de77bcc |
line diff
1.1 --- a/ppp/receipt Sat Feb 15 16:06:57 2020 +0100 1.2 +++ b/ppp/receipt Tue Mar 31 10:49:33 2020 +0200 1.3 @@ -31,10 +31,12 @@ 1.4 # Rules to gen a SliTaz package suitable for Tazpkg. 1.5 genpkg_rules() 1.6 { 1.7 - mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network/VPN 1.8 + mkdir -p $fs/usr/share/applications \ 1.9 + $fs/var/www/tazpanel/menu.d/network/VPN 1.10 cp -a $install/usr/sbin $fs/usr 1.11 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr 1.12 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel 1.13 + cp $stuff/*.desktop $fs/usr/share/applications 1.14 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp 1.15 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp 1.16 1.17 @@ -53,36 +55,22 @@ 1.18 cp -a $src/scripts/callback $fs/etc/ppp/scripts 1.19 cp -a $src/scripts/redialer $fs/etc/ppp/scripts 1.20 cat >> $fs/etc/ppp/ip-up <<EOT 1.21 -#!/bin/sh 1.22 - 1.23 if [ -x /etc/ppp/ip-up.d/\$6 ]; then 1.24 . /etc/ppp/ip-up.d/\$6 "\$@" 1.25 -elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then 1.26 +elif [ -n "\$DNS1\$DNS2" ]; then 1.27 rm -f /etc/ppp/resolv.prev 1.28 - if [ -f /etc/resolv.conf ]; then 1.29 - cp /etc/resolv.conf /etc/ppp/resolv.prev 1.30 - grep domain /etc/ppp/resolv.prev > /etc/resolv.conf 1.31 - grep search /etc/ppp/resolv.prev >> /etc/resolv.conf 1.32 - cat /etc/ppp/resolv.conf >> /etc/resolv.conf 1.33 - chmod 644 /etc/resolv.conf 1.34 - else 1.35 - cp /etc/ppp/resolv.conf /etc 1.36 - chmod 644 /etc/resolv.conf 1.37 - fi 1.38 + [ -s /etc/resolv.conf ] && mv -f /etc/resolv.conf /etc/ppp/resolv.prev 1.39 + [ -n "\$DNS1" ] && echo "nameserver \$DNS1" >> /etc/resolv.conf 1.40 + [ -n "\$DNS2" ] && echo "nameserver \$DNS2" >> /etc/resolv.conf 1.41 + chmod 644 /etc/resolv.conf 1.42 fi 1.43 EOT 1.44 cat >> $fs/etc/ppp/ip-down <<EOT 1.45 -#!/bin/sh 1.46 - 1.47 if [ -x /etc/ppp/ip-down.d/\$6 ]; then 1.48 . /etc/ppp/ip-down.d/\$6 "\$@" 1.49 -elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then 1.50 - if [ -f /etc/ppp/resolv.prev ]; then 1.51 - cp -f /etc/ppp/resolv.prev /etc/resolv.conf 1.52 - chmod 644 /etc/resolv.conf 1.53 - else 1.54 - rm -f /etc/resolv.conf 1.55 - fi 1.56 +elif [ -n "\$DNS1\$DNS2" ]; then 1.57 + rm -f /etc/resolv.conf 1.58 + mv -f /etc/ppp/resolv.prev /etc/resolv.conf 1.59 fi 1.60 EOT 1.61 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up 1.62 @@ -90,7 +78,6 @@ 1.63 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down 1.64 1.65 # insert #!/bin/sh on top line in ip* scripts 1.66 - sed -i '/#!\/bin\/sh/d' $fs/etc/ppp/ip* 2>/dev/null 1.67 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null 1.68 # add empty peers dir 1.69 mkdir -p $fs/etc/ppp/peers