71 PRIV_REQD },
72
73 { "delete-service", do_delete_service,
74 "\tdelete-service\t[-x] <svcname>",
75 PRIV_REQD },
76
77 { "list", do_list,
78 "\tlist\t[-n <svcname>]",
79 PRIV_NOT_REQD },
80
81 { "enable", do_enable,
82 "\tenable\t<svcname>",
83 PRIV_REQD },
84
85 { "disable", do_disable,
86 "\tdisable\t[-t] <svcname>",
87 PRIV_REQD },
88
89 { "create-client", do_create_client,
90 "\tcreate-client\t[-b <property>=<value>,...] \n"
91 "\t\t\t-e <macaddr> -t <imagepath> -n <svcname>",
92 PRIV_REQD },
93
94 { "delete-client", do_delete_client,
95 "\tdelete-client\t<macaddr>",
96 PRIV_REQD },
97
98 { "add", do_add,
99 "\tadd\t-m <manifest> -n <svcname>",
100 PRIV_REQD },
101
102 { "remove", do_remove,
103 "\tremove\t-m <manifest> -n <svcname>",
104 PRIV_REQD },
105
106 { "help", do_help,
107 "\thelp\t[<subcommand>]",
108 PRIV_NOT_REQD }
109 };
110
111 static void
1211 bootargs = optarg;
1212 break;
1213 case 'e':
1214 mac_addr = optarg;
1215 break;
1216 case 'n':
1217 svcname = optarg;
1218 break;
1219 case 't':
1220 imagepath = optarg;
1221 break;
1222 default:
1223 do_opterr(optopt, option, use);
1224 return (INSTALLADM_FAILURE);
1225 }
1226 }
1227
1228 /*
1229 * Make sure required options are there
1230 */
1231 if ((mac_addr == NULL) || (svcname == NULL) || (imagepath == NULL)) {
1232 (void) fprintf(stderr, MSG_MISSING_OPTIONS, argv[0]);
1233 (void) fprintf(stderr, "%s\n", gettext(use));
1234 return (INSTALLADM_FAILURE);
1235 }
1236
1237 if (!validate_service_name(svcname)) {
1238 (void) fprintf(stderr, MSG_BAD_SERVICE_NAME);
1239 return (INSTALLADM_FAILURE);
1240 }
1241
1242 ret = call_script(CREATE_CLIENT_SCRIPT, argc-1, &argv[1]);
1243 if (ret != 0) {
1244 return (INSTALLADM_FAILURE);
1245 }
1246
1247 /* if not enabled, enable install service */
1248 if (!check_for_enabled_install_services(handle)) {
1249 smf_service_enable_attempt(instance);
1250 }
1251
|
71 PRIV_REQD },
72
73 { "delete-service", do_delete_service,
74 "\tdelete-service\t[-x] <svcname>",
75 PRIV_REQD },
76
77 { "list", do_list,
78 "\tlist\t[-n <svcname>]",
79 PRIV_NOT_REQD },
80
81 { "enable", do_enable,
82 "\tenable\t<svcname>",
83 PRIV_REQD },
84
85 { "disable", do_disable,
86 "\tdisable\t[-t] <svcname>",
87 PRIV_REQD },
88
89 { "create-client", do_create_client,
90 "\tcreate-client\t[-b <property>=<value>,...] \n"
91 "\t\t\t-e <macaddr> -n <svcname> [-t <imagepath>]",
92 PRIV_REQD },
93
94 { "delete-client", do_delete_client,
95 "\tdelete-client\t<macaddr>",
96 PRIV_REQD },
97
98 { "add", do_add,
99 "\tadd\t-m <manifest> -n <svcname>",
100 PRIV_REQD },
101
102 { "remove", do_remove,
103 "\tremove\t-m <manifest> -n <svcname>",
104 PRIV_REQD },
105
106 { "help", do_help,
107 "\thelp\t[<subcommand>]",
108 PRIV_NOT_REQD }
109 };
110
111 static void
1211 bootargs = optarg;
1212 break;
1213 case 'e':
1214 mac_addr = optarg;
1215 break;
1216 case 'n':
1217 svcname = optarg;
1218 break;
1219 case 't':
1220 imagepath = optarg;
1221 break;
1222 default:
1223 do_opterr(optopt, option, use);
1224 return (INSTALLADM_FAILURE);
1225 }
1226 }
1227
1228 /*
1229 * Make sure required options are there
1230 */
1231 if ((mac_addr == NULL) || (svcname == NULL)) {
1232 (void) fprintf(stderr, MSG_MISSING_OPTIONS, argv[0]);
1233 (void) fprintf(stderr, "%s\n", gettext(use));
1234 return (INSTALLADM_FAILURE);
1235 }
1236
1237 if (!validate_service_name(svcname)) {
1238 (void) fprintf(stderr, MSG_BAD_SERVICE_NAME);
1239 return (INSTALLADM_FAILURE);
1240 }
1241
1242 ret = call_script(CREATE_CLIENT_SCRIPT, argc-1, &argv[1]);
1243 if (ret != 0) {
1244 return (INSTALLADM_FAILURE);
1245 }
1246
1247 /* if not enabled, enable install service */
1248 if (!check_for_enabled_install_services(handle)) {
1249 smf_service_enable_attempt(instance);
1250 }
1251
|