initctl: ignore missing files to delete command, simplify yorn() str

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-02-28 12:12:03 +01:00
1 parent e2f6ac0ece
commit 93f9856da8
1 file changed
+5 -3
+5 -3
View File
@@ -352,10 +352,12 @@ int serv_delete(char *arg)
if (!fn)
errx(1, FINIT_RCSD " missing on system.");
if (!fexist(fn))
errx(1, "Cannot find %s", fn);
if (!fexist(fn)) {
warnx(1, "Cannot find %s", fn);
return 1;
}
if (yorn("Remove %s and any enabled symlink (y/N)? ", fn)) {
if (yorn("Remove file and symlink(s) to %s (y/N)? ", fn)) {
do_disable(arg, 0);
remove(fn);
}