Implement process listing

This commit is contained in:
Salt 2020-06-15 09:51:20 -05:00
parent 688c3827f7
commit fbb725a949

View File

@ -125,6 +125,19 @@ fsexec() {
warn "Could not execute target: \"$filename\"" warn "Could not execute target: \"$filename\""
fi fi
} }
fslist() {
# List all valid services and what they point to
for file in "$_optconfigdir"/*; do
if ! [ -e "$file" ]; then
error "No configuration files found" 70
fi
# Skip our logs directory
[ "$_optlogdir" == "$file" ] && continue
if gettarget "$file"; then
echo "$(basename -- "$file")"
fi
done
}
fsstatus() { fsstatus() {
# List statistics about firestarter # List statistics about firestarter
warn "NYI" warn "NYI"
@ -303,6 +316,7 @@ If no command is specified, firestarter will behave as though init had been
provided provided
init Start all services and wait init Start all services and wait
list List all valid services
start Start the provided service, fork, and exit start Start the provided service, fork, and exit
status Show status information status Show status information
@ -327,6 +341,9 @@ firestart() {
step_wait step_wait
step_logout step_logout
;; ;;
list)
fslist
;;
start) start)
for file in "${_args[@]:1}"; do for file in "${_args[@]:1}"; do
fsexec "$_optconfigdir"/"$file" fsexec "$_optconfigdir"/"$file"