@@ -181,8 +181,7 @@ Operators:
|
||||
* `var name is file` / `is dir` / `is directory` / `is fs_object` / `is empty` —
|
||||
filesystem-style tests on the value.
|
||||
* `var name u value` — exit 0 if `value` is one of the array's elements.
|
||||
* `var name` — no operator: exit 0 unless the variable is unset, empty, or
|
||||
`false`/`0` (compared case-insensitively).
|
||||
* `var name` — create the accessor function and exit.
|
||||
* `name++` / `name--` — increment/decrement the first element.
|
||||
* `var name -v other_name` — build the accessor for `other_name` instead of
|
||||
`name` (so `name` acts on `other_name`).
|
||||
|
||||
@@ -296,6 +296,9 @@ svc() {
|
||||
|
||||
# Record the time every time we restart the loop
|
||||
printf -v last_respawn '%(%s)T'
|
||||
|
||||
# Sleep a bit between restarts
|
||||
sleep "$service_respawn_delay"
|
||||
done
|
||||
|
||||
#svc::cleanup
|
||||
@@ -668,6 +671,7 @@ var XDG_RUNTIME_DIR := "/run/user/$UID"
|
||||
## Let's set some defaults
|
||||
# These are meaningful to reconfigure.
|
||||
var service_respawn = 'no' # Respawn the service if it exits
|
||||
var service_respawn_delay = 1 # Wait a bit between restarts
|
||||
var service_workdir = '/'
|
||||
var service_stop_timeout = 30
|
||||
var service_stop_command = kill -n "\$service_stop_signal" "\$job_pid"
|
||||
|
||||
Reference in New Issue
Block a user