[Frugalware-darcs] setup-current: netconfig: added status 'profile'

VMiklos vmiklos at frugalware.org
Thu Mar 16 18:09:48 CET 2006


[netconfig: added status 'profile'
VMiklos <vmiklos at frugalware.org>**20060118214252] {
hunk ./src/config/netconfig.c 44
-	printf("usage: %s [options] start|stop|restart\n", myname);
+	printf("usage: %s [options] start|stop|restart|status\n", myname);
hunk ./src/config/netconfig.c 440
-		if((fn=lastprofile()) || !strcmp("stop", argv[optind]))
+		if((fn=lastprofile()) || !strcmp("stop", argv[optind]) || !strcmp("status", argv[optind]))
hunk ./src/config/netconfig.c 442
-			if(!strcmp("stop", argv[optind]) && !fn)
+			if((!strcmp("stop", argv[optind])) && !fn)
hunk ./src/config/netconfig.c 444
+			if((!strcmp("status", argv[optind])) && !fn)
+			{
+				printf("No profile loaded.\n");
+				return(1);
+			}
+			else
+			{
+				printf("Current profile: %s\n", fn);
+				return(0);
+			}
}


More information about the Frugalware-darcs mailing list