From owner-freebsd-current@freebsd.org Fri Sep 14 11:39:49 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F311080232 for ; Fri, 14 Sep 2018 11:39:49 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7A2F7E2C2 for ; Fri, 14 Sep 2018 11:39:48 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from hermann ([141.89.176.208]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LorB9-1fJzph46J9-00gmcV for ; Fri, 14 Sep 2018 13:34:35 +0200 Date: Fri, 14 Sep 2018 13:34:33 +0200 From: "Hartmann, O." To: FreeBSD CURRENT Subject: ppp.linkup: How is the !bg argument expanded and substituted? Message-ID: <20180914133433.26280064@hermann> Organization: walstatt.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:dc9xKkFskooGEldxrEXlTnILbppNHxN6Dhbi3bGiOaPJWhCM0Yq 03beZEEIpkcd0e8nE0cARfRCXRO8Xfbg1zTGDO8Y4Uf0CDTPXG46yGI9DEjno8treugFyLh xIV0d+h81xtzC6im4oTLqEg27LM3fsAAtMt5OJgfcZSaLC9Xrkuw9CyWCa0sBib4ioaBbp0 mns+oM3kfy/2oq0ZvLGIg== X-UI-Out-Filterresults: notjunk:1;V01:K0:K6Ikd8U2ALY=:viHNJOnrWO/CDgOxDYFWpN osclBdluVknz6h+InjB3xng1IyCa2+wPtnBXymiPSFvXy+02ahVAiOWMvdAdLtxnETNDsN6Xz mFIFvwE0Z7bFbNiiwrAULX3DLh7vUASJCNQjVD9zYW8DDw1x2XL7/D2ZJE+4PYU1OP+21R1Rt g4m/tVBDIvr6GyTjPHz+6ePo5d64VIhrsVm7J44mbyURtfFwakomIKEW2dpbg8zN3UEbI0W3O PjBTLWUOSP5BhNPNjTeD7flcsBPttkhZzCo+Uo3DsVZmNCjD3IDAGB6oAhjX+zuLUEB+z/3to 22ThCG8kcBqEZ6ZXkaeYg6PtsJs99Eb/+5/xPX9tkyvzEg7tcFV2ouw4UvOqPLAuzYmG2UCVn 6fiPUOVIRsmjQkf2v1oDSBaWY4/GY4caW3ePzo6Sc7jue43MtrZM9vMZ+xy/cx5iW0O/VmcgF T6VIlUF3orS7KUwBjjYFOx+ylN+FAr30p0QgWzR7dGxuGmfKfI2FbHHyCWFrAgx0G99TZVqI7 d7gcp5kND98UBfb25tCQf7D9Yx7rBIi3V1dCxfovvnYLTN0A/lRFdcxt1zeNCGVq6n4tbvZZW De/k/fY3SOHbP1m9NzQ2Ov0aRbWF7VTJ90oGLFr1nmRKNplas6dxHfMUptF3M2JC2qpC1Z+g+ Bg9kOmNLC3RCpELhzfBIk9XaEpg0Kk+MLe4JEA1a256fe1wGyePKxk5DIbPAyCiu13Wlj916R b0Povdbd9XNpnECyiJhIsNMSXbeopzypvxL2/QNyUGiSjR5MWIAVnv2pvBq1TthSfOtJzdWmI 3LKDYL1c55uhp1de7J+bD41A02IDxah5a0Y2KKL+6joFYOXS0M= X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2018 11:39:49 -0000 Hello list, my question may sound blunt but I miss something with the documentation of ppp(8). Background: My homeoffice is running a network and server infrastructure I'd like to access from the internet, therefore, I use a DDNS service. My gateway is a FreeBSD based small, efficient NanoBSD based system acting as firewall, router and performing some gatewaying stuff. Recently the usually used dns/ddclient stopped working on recent CURRENT running on that gateway (FreeBSD 12.0-ALPHA5 #32 r338541: Sun Sep 9 09:27:47 CEST 2018 amd64, NETINET6 enabled, secureretylevel=1, all NICs have only IPv6 linklocal, exterior IF is tun0 with a regular IPv4 assign by my ISP and only linklocal IPv6). dns/ddclient stopped working out of the blue and I need an alternative to update my IP (ipv4) at my DDNS provider. To achiev the requested IPv4 updates as done via ddclient I used /etc/ppp/ppp.linkup with a !bg command this way: !bg /usr/local/bin/curl -v -X PUT -u \ \"email@host.de:SOME_TOKEN_GIVEN_BY_PROVIDER\" \ -d '{\"ip_address\": \"auto\"}' https://api.twodns.de/hosts/all It is ONE ROW, I broke it up for presentation here. Somehow I needed to escape some quotes like \"; I tried to check how ppp would emmit the !bg command via a logger statement with the very same line - the reason is I can't see what ppp is doing and since DDNS updates never were performed so far via ppp.linkup I consider some mistakes here. For the JSON data (after -d '{...}'), quoted tags are requisite. When I issue the command on the gateway without the escaped quotes to achieve the command line: /usr/local/bin/curl -v -X PUT -u \ "email@host.de:SOME_TOKEN_GIVEN_BY_PROVIDER" \ -d '{"ip_address": "auto"}' https://api.twodns.de/hosts/all everythings works perfect: the IP gets updated, the DDNS provider respons with status code "200 OK". So far. But somehow this never happens or is successful with the !bg statement from ppp.linkup when the IP changes on that link and ppp.linkup is triggered. Since I do not see why (it seems that the response from the !bg command is lost), I need to check the substitutions. Can someone enlighted please shed some illumination on that problem? It would really help to hint me to the doc were I can read about the way the command string is parsed/interpreted by ppp (I only found the substitutions for MYADDR, MYADDR6 and so on in man ppp(8)). Thanks in advance, Oliver