commit 4aa657f58bb05c24c88dc2e728c81641bd060567
parent 3abfdb4bb044b6b0176ff987e92ca005810e25c7
Author: Cem Keylan <cem@ckyln.com>
Date: Tue, 25 Feb 2020 10:24:12 +0300
replace the find command with 'ls' so that it is more portable.
The '-type f' also did not show symlinks which many people do from
an '/etc' directory. I was going to replace it with '! -type d' which
meant anything but a directory, but 'ls' should be just fine since
we are not doing a complicated thing.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysmgr b/sysmgr
@@ -80,7 +80,7 @@ fn_sysmgr() {
# given SYSDIR exists, and has service files installed.
[ "$SYSDIR" ] || die "Please specify service directory"
[ -d "$SYSDIR" ] || die "$SYSDIR does not exist."
- [ "$(find "$SYSDIR" -type f)" ] || die "No service file is found"
+ [ "$(ls -1 "$SYSDIR")" ] || die "No service file is found"
mkdir -p "$RUNDIR" || die
# Add pid to $RUNDIR before starting loops