From owner-freebsd-questions@FreeBSD.ORG Thu Jun 18 06:05:49 2015 Return-Path: Delivered-To: freebsd-questions@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 134C8E67 for ; Thu, 18 Jun 2015 06:05:49 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5F8DF01 for ; Thu, 18 Jun 2015 06:05:48 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [89.204.155.27] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1Z5SxH-0008Hl-A3 for freebsd-questions@freebsd.org; Thu, 18 Jun 2015 08:05:39 +0200 Received: from localhost.my.domain (c720-r276659 [127.0.0.1]) by localhost.unixarea.de (8.14.9/8.14.9) with ESMTP id t5I65Z6g004011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 18 Jun 2015 08:05:35 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.14.9/8.14.9/Submit) id t5I65YLT004010 for freebsd-questions@freebsd.org; Thu, 18 Jun 2015 08:05:34 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Thu, 18 Jun 2015 08:05:34 +0200 From: Matthias Apitz To: freebsd-questions@freebsd.org Subject: /etc/pccard_ether && assigning IP and routing Message-ID: <20150618060534.GA3970@c720-r276659> Reply-To: Matthias Apitz Mail-Followup-To: Matthias Apitz , freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 11.0-CURRENT r269739 (i386) User-Agent: Mutt/1.5.23 (2014-03-12) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 89.204.155.27 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2015 06:05:49 -0000 Hello, I own an Ubuntu phone BQ E4.5 and when I attach this on USB to my FreeBSD netbook the devd(8) launches /etc/pccard_ether ue0 start which works fine and the interface ue0 comes UP. I'd like to run an additional script to assign IP via dhcclient, establish a default route and restart sendmail. I do this manually as root with a script: #!/bin/sh # # change routing (...) to the Ubuntu phone BQ Aqaris E4.5 # ifconfig ue0 || { printf "interface ue0 not found -- exit.\n" exit 1 } ifconfig wlan0 down route delete default killall dhclient rm -f /etc/resolv.conf dhclient ue0 /etc/rc.d/sendmail stop sleep 3 /etc/rc.d/sendmail start I found no way with devd(8) hooks to run this script when interface ue0 comes up. Any ideas? Thanks in advance. matthias -- Matthias Apitz, guru@unixarea.de, http://www.unixarea.de/ +49-170-4527211 +49-176-38902045 "Wenn der Mensch von den Umständen gebildet wird, so muß man die Umstände menschlich bilden." "Si el hombre es formado por las circunstancias entonces es necesario formar humanamente las circunstancias", Karl Marx in Die heilige Familie / La sagrada familia (MEW 2, 138)