]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add -x option to quit without releasing the lease.
authorRoy Marples <roy@marples.name>
Fri, 3 Aug 2007 10:33:07 +0000 (10:33 +0000)
committerRoy Marples <roy@marples.name>
Fri, 3 Aug 2007 10:33:07 +0000 (10:33 +0000)
ChangeLog
dhcpcd.8
dhcpcd.c

index e9f196eb26b68036bd54004823e579cc67148ba7..a318e496674605712c2e231e5b8554941cba7476 100644 (file)
--- 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.
 
index 27c4ed50aee331d2f4f7a642f0f0f1716445a4b5..573cbe83c03001703ed66d35631ea1a8f904428c 100644 (file)
--- 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
index b9ee650ec3947bee3c990b3f4a5972c3eacb6960..01bf3166e52cbb367904bd4dbd7f9faf7671548b 100644 (file)
--- 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");