From: Roy Marples Date: Fri, 3 Aug 2007 10:33:07 +0000 (+0000) Subject: Add -x option to quit without releasing the lease. X-Git-Tag: v3.2.3~219 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7159a07a651c8f377c55a46c1bd201312528716c;p=thirdparty%2Fdhcpcd.git Add -x option to quit without releasing the lease. --- diff --git a/ChangeLog b/ChangeLog index e9f196eb..a318e496 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +Add -x option to quit without releasing the lease. + dhcpcd-3.1.3 Fix link routes which broke in 3.1.2. diff --git a/dhcpcd.8 b/dhcpcd.8 index 27c4ed50..573cbe83 100644 --- a/dhcpcd.8 +++ b/dhcpcd.8 @@ -186,6 +186,22 @@ fixed hardware addresses. You can specify more than one user class, but the total length must be less than 255 characters, -1 character for each user class. .TP +.BI \-x +Sends +.B SIGTERM +signal to the +.B dhcpcd +process associated with the specified interface if one is currently running. If +.B dhcpcd +receives +.B SIGTERM +it will stop running, de-configure the interface and exit. +(see also +.B -k +and +.B -p +) +.TP .BI \-A Don't do an .B ARP diff --git a/dhcpcd.c b/dhcpcd.c index b9ee650e..01bf3166 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -113,6 +113,7 @@ int main(int argc, char **argv) {"request", optional_argument, NULL, 'r'}, {"timeout", required_argument, NULL, 't'}, {"userclass", required_argument, NULL, 'u'}, + {"exit", no_argument, NULL, 'x'}, {"lastlease", no_argument, NULL, 'E'}, {"fqdn", required_argument, NULL, 'F'}, {"nogateway", no_argument, NULL, 'G'}, @@ -158,7 +159,7 @@ int main(int argc, char **argv) /* Don't set any optional arguments here so we retain POSIX * compatibility with getopt */ - while ((opt = getopt_long(argc, argv, "c:dh:i:kl:m:npr:s:t:u:AEF:GHI:LMNRTY", + while ((opt = getopt_long(argc, argv, "c:dh:i:kl:m:npr:s:t:u:xAEF:GHI:LMNRTY", longopts, &option_index)) != -1) { switch (opt) { @@ -277,6 +278,9 @@ int main(int argc, char **argv) options.userclass_len += (strlen (optarg)) + 1; } break; + case 'x': + options.signal = SIGTERM; + break; case 'A': #ifndef ENABLE_ARP logger (LOG_ERR, "arp support not compiled into dhcpcd");