#!/usr/local/bin/perl # index.cgi # Display a list of services, built from svcs command require './smf-lib.pl'; &ReadParse(); &ui_print_header(undef, $text{'property_group_editor_title'}, ""); # get instance fmri if (defined($in{'fmri'})) { $fmri = $in{'fmri'}; # remove quotes... $fmri =~ /\'([^\']*)\'/; $fmri = $1; if ($fmri =~ /(svc:\/[^:]*):(.*)/) { $svc = $1; $inst = $2; } else { &error("Invalid fmri: instance must be specified!"); } } else { &error("No fmri supplied to property group editor!"); } # deal with add/deletion of property groups first. this way # pgroup list will show changes... if ((defined($in{'add'})) && (defined($in{'addname'})) && (defined($in{'addtype'})) && (defined($in{'addsinst'}))) { $addname = "$in{'addname'}"; $addtype = "$in{'addtype'}"; $addsinst = "$in{'addsinst'}"; if (($addname =~ /.+/) && ($addtype =~ /.+/) && ($addsinst =~ /.+/)) { &svc_addpg("$svc", "$addsinst", "$addname", "$addtype"); } } if (defined($in{'remove'})) { # get remove pg list @remove_pgs = split(/\0/, $in{'applyto'}); foreach $rpg (@remove_pgs) { # split into service or instance level/name if ($rpg =~ /([^\/]*)\/(.*)/) { $pgsinst = $1; $pgname = $2; &svc_delpg("$svc", "$pgsinst", "$pgname"); } } } @pgroup_listing_svc = &svc_listpg($svc, "service"); @pgroup_listing_inst = &svc_listpg($svc, $inst); @pgroup_listing = (@pgroup_listing_svc, @pgroup_listing_inst); print "