mirror of
https://github.com/troglobit/finit.git
synced 2026-10-21 11:29:42 +00:00
initctl: introduce -f,--force option, for delete command
Never prompt, for scripting. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
5dcf7be3c9
commit
460add3cae
2 files changed
+12
-6
No files matched your search
+4
-5
@@ -33,6 +33,7 @@
|
||||
#include "util.h"
|
||||
|
||||
extern int icreate; /* initctl -c */
|
||||
extern int iforce; /* initctl -f */
|
||||
|
||||
|
||||
static int calc_width(char *arr[], size_t len)
|
||||
@@ -352,12 +353,10 @@ int serv_delete(char *arg)
|
||||
if (!fn)
|
||||
errx(1, FINIT_RCSD " missing on system.");
|
||||
|
||||
if (!fexist(fn)) {
|
||||
warnx("Cannot find %s", fn);
|
||||
return 1;
|
||||
}
|
||||
if (!fexist(fn))
|
||||
warnx("cannot find %s", fn);
|
||||
|
||||
if (yorn("Remove file and symlink(s) to %s (y/N)? ", fn)) {
|
||||
if (iforce || yorn("Remove file and symlink(s) to %s (y/N)? ", fn)) {
|
||||
do_disable(arg, 0);
|
||||
remove(fn);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user