Revision 4e2a765a
Added by Viktor Gurov over 3 years ago
src/etc/inc/service-utils.inc | ||
---|---|---|
64 | 64 |
$towrite .= "rc_stop() {\n"; |
65 | 65 |
$towrite .= "\t{$tokill}\n"; |
66 | 66 |
$towrite .= "}\n\n"; |
67 |
if (!empty($params['restart'])) { |
|
68 |
$torestart = &$params['restart']; |
|
69 |
} else { |
|
70 |
$torestart = "\trc_stop()\n"; |
|
71 |
$torestart .= "\trc_start()\n"; |
|
72 |
} |
|
73 |
$towrite .= "rc_restart() {\n"; |
|
74 |
$towrite .= "\t{$torestart}\n"; |
|
75 |
$towrite .= "}\n\n"; |
|
67 | 76 |
|
68 | 77 |
/* begin rcfile logic */ |
69 |
$towrite .= "case \$1 in\n\tstart)\n\t\trc_start\n\t\t;;\n\tstop)\n\t\trc_stop\n\t\t;;\n\trestart)\n\t\trc_stop\n\t\trc_start\n\t\t;;\nesac\n\n";
|
|
78 |
$towrite .= "case \$1 in\n\tstart)\n\t\trc_start\n\t\t;;\n\tstop)\n\t\trc_stop\n\t\t;;\n\trestart)\n\t\trc_restart\n\t\t;;\nesac\n\n";
|
|
70 | 79 |
|
71 | 80 |
@file_put_contents($rcfile_fullname, $towrite); |
72 | 81 |
unset($towrite); |
Also available in: Unified diff
write_rcfile() restart support. Issue #13004