Added Edit command

Command Edit <CONF>  opens file /etc/finit.d/available/<CONF>.conf in
the editor referenced by Linux environment variable $EDITOR
If $EDITOR is not set it will try to open emacs and if emacs is not
found it will try to open the file in vim.

Signed-off-by: Andreas Egeberg <andreas.egeberg@gmail.com>
This commit is contained in:
Andreas Egeberg
2021-02-26 10:28:21 +01:00
committed by Andreas Egeberg
parent fc82f0242c
commit 60d0ca1075
3 changed files with 35 additions and 1 deletions
+3 -1
View File
@@ -659,7 +659,8 @@ static int usage(int rc)
" disable <CONF> Disable .conf in /etc/finit.d/[enabled/]\n"
" touch <CONF> Mark .conf in /etc/finit.d/ for reload\n"
" reload Reload *.conf in /etc/finit.d/ (activates changes)\n"
// " reload <JOB|NAME>[:ID] Reload (SIGHUP) service by job# or name\n"
// " reload <JOB|NAME>[:ID] Reload (SIGHUP) service by job# or name\n"
" edit <CONF> Edit .conf in /etc/finit.d/available/\n"
"\n"
" cond show Show condition status\n"
" cond dump Dump all conditions and their status\n"
@@ -709,6 +710,7 @@ int main(int argc, char *argv[])
{ "enable", serv_enable },
{ "disable", serv_disable },
{ "touch", serv_touch },
{ "edit", serv_edit },
{ "reload", do_reload },
{ "cond", do_cond },