#!/usr/bin/perl # edit_hostconfig.cgi # # Edit the settings in the hostconfig file, or the # StartupItems script or plist associated with the # action described in the hostconfig file. # # Also create a new startup action with associated script and plist # and manually modify hostconfig file. require './init-lib.pl'; require './hostconfig-lib.pl'; use File::Basename; $access{'bootup'} == 1 || &error($text{'edit_ecannot'}); $ty = $ARGV[0]; if ($ty == 0) { # Editing an existing action in /etc/hostconfig $action_to_edit = $ARGV[1]; &ui_print_header(undef, $text{'edit_title'}, ""); %startuphash = &hostconfig_gather(startscript); $startscript = $startuphash{"$action_to_edit"}; if ( $startscript ne "") { $startupdir = dirname("$startscript"); $plistedit = "$startupdir/$config{'plist'}"; } else { $plistedit = ""; } #create the action edit table $actionedit = &hostconfig_editaction("$action_to_edit", "$startscript"); print "<form action=modifyhostconfig.cgi method=post name=hostmod>\n"; print "<table width=\"100%\" border><tr $tb> <td><b>", &text('index_action'), "</b></td>\n"; print "<td><b>", &text('index_setting'), "</b></td></tr>\n"; print "<tr $cb><td valign=middle>$action_to_edit</td>\n"; print "<td>$actionedit</td></tr></table>\n"; print "<input type=submit value='$text{'save'}'></form>\n"; #create the edit file forms if ($startscript ne "") { print &ui_hr(); print &text('edit_hostconfig_startup', "<tt>$startscript</tt>"),"<br>\n"; # } print "<form action=save_startscript.cgi method=post>\n"; print "<textarea name=startup rows=20 cols=80>"; open(STARTSCRIPT, "<$startscript"); while(<STARTSCRIPT>) { print; } close(STARTSCRIPT); print "</textarea><br>\n"; print "<input type=hidden name=\"action\" value=\"$action_to_edit\">\n"; print "<input type=submit value='$text{'save'}'></form>\n"; } if ($plistedit ne "") { print &ui_hr(); print &text('edit_hostconfig_plist', "<tt>$plistedit</tt>"),"<br>\n"; # } print "<form action=save_startscript.cgi method=post>\n"; print "<textarea name=plist rows=20 cols=80>"; open(PLIST, "<$plistedit"); while(<PLIST>) { print; } close(PLIST); print "</textarea><br>\n"; print "<input type=hidden name=\"action\" value=\"$action_to_edit\">\n"; # print "$plistedit</textarea><br>\n"; print "<input type=submit value='$text{'save'}'></form>\n"; } } if ($ty == 1) { &ui_print_header(undef, $text{'edit_hostconfig_new'}, ""); print "<HR>\n"; print "<P>\n", &text('edit_hostconfig_noquotes', "<tt>$text{'edit_start'}</tt>"),"\n"; print "<P>\n", &text('edit_hostconfig_startitems', "<tt>$text{'edit_hostconfig_actionname'}</tt>", "<tt>$text{'edit_hostconfig_scriptname'}</tt>"),"\n"; print "<P>\n", &text('edit_hostconfig_array', "<tt>Provides</tt>", "<tt>Requires</tt>", "<tt>Uses</tt>"),"\n"; print "<P>\n $text{'edit_hostconfig_further'}\n"; #print "<form method=post action=save_hostconfig_action.cgi enctype=multipart/form-data>\n"; print "<form method=post action=save_hostconfig_action.cgi>\n"; print "<table border>\n"; print "<tr $tb><td><b>Action Details</b></td></tr>\n"; print "<tr $cb><td><table cellpadding=3>\n"; # create the form fields $textt=&hostconfig_createtext("Action Name","req"); print "<tr>", &hostconfig_createtext("$text{'edit_hostconfig_actionname'}","req"); print "<td><input size=20 name=action_name value=\"\"></td></tr>\n"; print "<tr>", &hostconfig_createtext("$text{'edit_hostconfig_scriptname'}","req"); print "<td><input size=20 name=script_name value=\"\"></td></tr>\n"; print "<tr>", &hostconfig_createtext("$text{'edit_start'}","req"); print "<td><font size=-1><textarea rows=5 cols=80 name=execute></textarea></font></td></tr>\n"; print "<tr>", &hostconfig_createtext("$text{'index_desc'}",""); print "<td><input size=60 name=description value=\"\"></td></tr>\n"; print "<tr>", &hostconfig_createtext("Provides",""); print "<td><input size=60 name=provides value=\"\"></td></tr>\n"; print "<tr>", &hostconfig_createtext("Requires",""); print "<td><input size=60 name=requires value=\"\"></td></tr>\n"; print "<tr>", &hostconfig_createtext("Uses",""); print "<td><input size=60 name=uses value=\"\"></td></tr>\n"; print "<tr>", &hostconfig_createtext("OrderPreference",""); print "<td><SELECT name=order><option value=First>First</option>", "<option value=Early>Early</option>", "<option value='None selected'>None</option>", "<option value=Late>Late</option>", "<option value=Last>Last</option>", "</select></td></tr>\n"; print "<tr>", &hostconfig_createtext("Start Message",""); print "<td><input size=60 name=start value=\"\"></td></tr>\n"; print "<tr>", &hostconfig_createtext("Stop Message",""); print "<td><input size=60 name=stop value=\"\"></td></tr>\n"; print "<tr>", &hostconfig_createtext("Start at boot time?",""); print "<td><input name=boot type=radio value=\"-YES-\"> Yes\n"; print "<input name=boot type=radio value=\"-NO-\" checked> No</td></tr>\n"; print "<tr><td><font size=-1 color=#ff0000>* required field</font></td><td> </td></tr>\n"; print "</table>"; print "</td></tr></table>\n"; print "<input type=submit value=\"Create\"></form>\n"; } if ($ty == 2) { &ui_print_header(undef, $text{'edit_hostconfig_title'}, ""); print &text('edit_hostconfig_hostconfig', "<tt>$config{'hostconfig'}</tt>"),"<br>\n"; print "<form action=save_startscript.cgi method=post>\n"; print "<textarea name=hostconfig rows=20 cols=80>"; open(LOCAL, "<$config{'hostconfig'}"); while(<LOCAL>) { print; } close(LOCAL); print "</textarea><br>\n"; print "<input type=submit value='$text{'save'}'></form>\n"; print &ui_hr(); #add reboot and shutdown messages to this page as well... print "<table cellpadding=5 width=100%>\n"; if ($access{'reboot'}) { print "<form action=reboot.cgi>\n"; print "<tr> <td><input type=submit ", "value=\"$text{'index_reboot'}\"></td>\n"; print "</form>\n"; print "<td>$text{'index_rebootmsg'}</td> </tr>\n"; } if ($access{'shutdown'}) { print "<form action=shutdown.cgi>\n"; print "<tr> <td><input type=submit ", "value=\"$text{'index_shutdown'}\"></td>\n"; print "</form>\n"; print "<td>$text{'index_shutdownmsg'}</td> </tr>\n"; } print "</table>\n"; } &ui_print_footer("", $text{'index_return'});
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
help | Folder | 0755 |
|
|
images | Folder | 0755 |
|
|
lang | Folder | 0755 |
|
|
CHANGELOG | File | 1.8 KB | 0644 |
|
acl_security.pl | File | 869 B | 0755 |
|
atboot.pl | File | 5.66 KB | 0755 |
|
backup_config.pl | File | 975 B | 0755 |
|
cgi_args.pl | File | 668 B | 0755 |
|
change_rl.cgi | File | 486 B | 0755 |
|
config-aix | File | 204 B | 0644 |
|
config-cobalt-linux-2.2-4.0 | File | 242 B | 0644 |
|
config-cobalt-linux-5.0-ALL | File | 257 B | 0644 |
|
config-coherent-linux | File | 277 B | 0644 |
|
config-corel-linux | File | 179 B | 0644 |
|
config-debian-linux | File | 195 B | 0644 |
|
config-freebsd | File | 154 B | 0644 |
|
config-freebsd-5.0-ALL | File | 251 B | 0644 |
|
config-generic-linux | File | 238 B | 0644 |
|
config-gentoo-linux | File | 166 B | 0644 |
|
config-hpux | File | 233 B | 0644 |
|
config-irix | File | 186 B | 0644 |
|
config-macos | File | 267 B | 0644 |
|
config-mandrake-linux | File | 277 B | 0644 |
|
config-msc-linux | File | 272 B | 0644 |
|
config-netbsd | File | 106 B | 0644 |
|
config-open-linux | File | 208 B | 0644 |
|
config-openSUSE-Linux-15.0-ALL | File | 236 B | 0644 |
|
config-openbsd | File | 106 B | 0644 |
|
config-openmamba-linux | File | 277 B | 0644 |
|
config-openserver | File | 208 B | 0644 |
|
config-osf1 | File | 214 B | 0644 |
|
config-pardus-linux | File | 238 B | 0644 |
|
config-redhat-linux | File | 277 B | 0644 |
|
config-slackware-linux | File | 129 B | 0644 |
|
config-solaris | File | 195 B | 0644 |
|
config-solaris-10-ALL | File | 225 B | 0644 |
|
config-suse-linux | File | 187 B | 0644 |
|
config-suse-linux-7.1-ALL | File | 236 B | 0644 |
|
config-syno-linux | File | 247 B | 0644 |
|
config-trustix-linux | File | 262 B | 0644 |
|
config-turbo-linux | File | 257 B | 0644 |
|
config-united-linux | File | 197 B | 0644 |
|
config-unixware | File | 178 B | 0644 |
|
config-windows | File | 115 B | 0644 |
|
config.info | File | 1.31 KB | 0644 |
|
config.info.ca | File | 1.54 KB | 0644 |
|
config.info.cs | File | 1.27 KB | 0644 |
|
config.info.de | File | 1.46 KB | 0644 |
|
config.info.es | File | 1.31 KB | 0644 |
|
config.info.eu | File | 1.35 KB | 0644 |
|
config.info.fa | File | 1.78 KB | 0644 |
|
config.info.fr | File | 1.18 KB | 0644 |
|
config.info.hu | File | 0 B | 0644 |
|
config.info.ja | File | 1.57 KB | 0644 |
|
config.info.ko | File | 1.19 KB | 0644 |
|
config.info.nl | File | 1.25 KB | 0644 |
|
config.info.no | File | 1.41 KB | 0644 |
|
config.info.pl | File | 1.22 KB | 0644 |
|
config.info.ru | File | 2.05 KB | 0644 |
|
config.info.sk | File | 0 B | 0644 |
|
config.info.sv | File | 549 B | 0644 |
|
config.info.tr | File | 515 B | 0644 |
|
config.info.uk | File | 1.45 KB | 0644 |
|
config.info.zh | File | 388 B | 0644 |
|
config.info.zh_TW | File | 727 B | 0644 |
|
create-boot.pl | File | 424 B | 0755 |
|
defaultacl | File | 40 B | 0644 |
|
delboot.pl | File | 688 B | 0755 |
|
delete-boot.pl | File | 379 B | 0755 |
|
delete_action.cgi | File | 907 B | 0755 |
|
edit_action.cgi | File | 5.12 KB | 0755 |
|
edit_hostconfig.cgi | File | 6.2 KB | 0755 |
|
edit_launchd.cgi | File | 2.05 KB | 0755 |
|
edit_rc.cgi | File | 1.84 KB | 0755 |
|
edit_systemd.cgi | File | 2.4 KB | 0755 |
|
edit_upstart.cgi | File | 2.3 KB | 0755 |
|
fix_action.cgi | File | 600 B | 0755 |
|
hostconfig-lib.pl | File | 8.53 KB | 0755 |
|
index.cgi | File | 13.7 KB | 0755 |
|
init-lib.pl | File | 68 KB | 0644 |
|
log_parser.pl | File | 1.37 KB | 0755 |
|
mass_launchd.cgi | File | 1.94 KB | 0755 |
|
mass_rcs.cgi | File | 1.54 KB | 0755 |
|
mass_start_stop.cgi | File | 2.81 KB | 0755 |
|
mass_systemd.cgi | File | 2.68 KB | 0755 |
|
mass_upstarts.cgi | File | 1.94 KB | 0755 |
|
modifyhostconfig.cgi | File | 1.07 KB | 0755 |
|
module.info | File | 305 B | 0644 |
|
module.info.af | File | 0 B | 0644 |
|
module.info.af.auto | File | 156 B | 0644 |
|
module.info.ar | File | 0 B | 0644 |
|
module.info.ar.auto | File | 207 B | 0644 |
|
module.info.be | File | 0 B | 0644 |
|
module.info.be.auto | File | 246 B | 0644 |
|
module.info.bg | File | 0 B | 0644 |
|
module.info.bg.auto | File | 253 B | 0644 |
|
module.info.ca | File | 0 B | 0644 |
|
module.info.ca.auto | File | 174 B | 0644 |
|
module.info.cs | File | 0 B | 0644 |
|
module.info.cs.auto | File | 168 B | 0644 |
|
module.info.da | File | 0 B | 0644 |
|
module.info.da.auto | File | 150 B | 0644 |
|
module.info.de | File | 0 B | 0644 |
|
module.info.de.auto | File | 148 B | 0644 |
|
module.info.el | File | 0 B | 0644 |
|
module.info.el.auto | File | 277 B | 0644 |
|
module.info.es | File | 0 B | 0644 |
|
module.info.es.auto | File | 173 B | 0644 |
|
module.info.eu | File | 0 B | 0644 |
|
module.info.eu.auto | File | 142 B | 0644 |
|
module.info.fa | File | 0 B | 0644 |
|
module.info.fa.auto | File | 201 B | 0644 |
|
module.info.fi | File | 0 B | 0644 |
|
module.info.fi.auto | File | 177 B | 0644 |
|
module.info.fr | File | 0 B | 0644 |
|
module.info.fr.auto | File | 169 B | 0644 |
|
module.info.he | File | 0 B | 0644 |
|
module.info.he.auto | File | 171 B | 0644 |
|
module.info.hr | File | 0 B | 0644 |
|
module.info.hr.auto | File | 158 B | 0644 |
|
module.info.hu | File | 0 B | 0644 |
|
module.info.hu.auto | File | 184 B | 0644 |
|
module.info.it | File | 0 B | 0644 |
|
module.info.it.auto | File | 139 B | 0644 |
|
module.info.ja | File | 0 B | 0644 |
|
module.info.ja.auto | File | 202 B | 0644 |
|
module.info.ko | File | 0 B | 0644 |
|
module.info.ko.auto | File | 156 B | 0644 |
|
module.info.lt | File | 0 B | 0644 |
|
module.info.lt.auto | File | 172 B | 0644 |
|
module.info.lv | File | 0 B | 0644 |
|
module.info.lv.auto | File | 177 B | 0644 |
|
module.info.ms | File | 0 B | 0644 |
|
module.info.ms.auto | File | 142 B | 0644 |
|
module.info.mt | File | 0 B | 0644 |
|
module.info.mt.auto | File | 141 B | 0644 |
|
module.info.nl | File | 0 B | 0644 |
|
module.info.nl.auto | File | 160 B | 0644 |
|
module.info.no | File | 0 B | 0644 |
|
module.info.no.auto | File | 148 B | 0644 |
|
module.info.pl | File | 0 B | 0644 |
|
module.info.pl.auto | File | 163 B | 0644 |
|
module.info.pt | File | 0 B | 0644 |
|
module.info.pt.auto | File | 199 B | 0644 |
|
module.info.pt_BR | File | 0 B | 0644 |
|
module.info.pt_BR.auto | File | 208 B | 0644 |
|
module.info.ro | File | 0 B | 0644 |
|
module.info.ro.auto | File | 176 B | 0644 |
|
module.info.ru | File | 0 B | 0644 |
|
module.info.ru.auto | File | 249 B | 0644 |
|
module.info.sk | File | 0 B | 0644 |
|
module.info.sk.auto | File | 172 B | 0644 |
|
module.info.sl | File | 0 B | 0644 |
|
module.info.sl.auto | File | 158 B | 0644 |
|
module.info.sv | File | 0 B | 0644 |
|
module.info.sv.auto | File | 154 B | 0644 |
|
module.info.th | File | 0 B | 0644 |
|
module.info.th.auto | File | 270 B | 0644 |
|
module.info.tr | File | 0 B | 0644 |
|
module.info.tr.auto | File | 218 B | 0644 |
|
module.info.uk | File | 0 B | 0644 |
|
module.info.uk.auto | File | 283 B | 0644 |
|
module.info.ur | File | 0 B | 0644 |
|
module.info.ur.auto | File | 200 B | 0644 |
|
module.info.vi | File | 0 B | 0644 |
|
module.info.vi.auto | File | 195 B | 0644 |
|
module.info.zh | File | 0 B | 0644 |
|
module.info.zh.auto | File | 140 B | 0644 |
|
module.info.zh_TW | File | 0 B | 0644 |
|
module.info.zh_TW.auto | File | 149 B | 0644 |
|
prefs.info | File | 55 B | 0644 |
|
rbac-mapping | File | 80 B | 0644 |
|
reboot.cgi | File | 725 B | 0755 |
|
save_action.cgi | File | 6.37 KB | 0755 |
|
save_hostconfig_action.cgi | File | 4.63 KB | 0755 |
|
save_launchd.cgi | File | 1.72 KB | 0755 |
|
save_local.cgi | File | 706 B | 0755 |
|
save_rc.cgi | File | 2.48 KB | 0755 |
|
save_services.cgi | File | 1.44 KB | 0755 |
|
save_startscript.cgi | File | 1.9 KB | 0755 |
|
save_systemd.cgi | File | 2.03 KB | 0755 |
|
save_upstart.cgi | File | 2.15 KB | 0755 |
|
shutdown.cgi | File | 591 B | 0755 |
|
start_stop.cgi | File | 890 B | 0755 |
|
syslog_logs.pl | File | 350 B | 0755 |
|
uninstall.pl | File | 1.91 KB | 0755 |
|
updateboot.pl | File | 936 B | 0755 |
|
win32.pl | File | 1.93 KB | 0755 |
|