Make "dinitctl start" start a service and "dinitctl stop" stop a
authorDavin McCall <davmac@davmac.org>
Thu, 7 Jan 2016 10:52:31 +0000 (10:52 +0000)
committerDavin McCall <davmac@davmac.org>
Thu, 7 Jan 2016 10:52:31 +0000 (10:52 +0000)
service, rather than the other way around...

src/dinitctl.cc

index 3e1782a61a6b1c585934e3b01c750e1d17967e5a..5be3ebc2e6970924e44497c7fc400031554bd731 100644 (file)
@@ -91,10 +91,10 @@ int main(int argc, char **argv)
             }
         }
         else if (command == 0) {
-            if (strcmp(argv[i], "start")) {
+            if (strcmp(argv[i], "start") == 0) {
                 command = START_SERVICE; 
             }
-            else if (strcmp(argv[i], "stop")) {
+            else if (strcmp(argv[i], "stop") == 0) {
                 command = STOP_SERVICE;
             }
             else {
@@ -110,7 +110,7 @@ int main(int argc, char **argv)
         }
     }
     
-    if (service_name == nullptr || command = 0) {
+    if (service_name == nullptr || command == 0) {
         show_help = true;
     }