change namespacing from :: to service::
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
da1ffe1a7b
commit
dfd942ca49
9
ssm
9
ssm
|
@ -124,7 +124,7 @@ die() {
|
||||||
}; readonly -f die
|
}; readonly -f die
|
||||||
|
|
||||||
if_service_action() {
|
if_service_action() {
|
||||||
for f in "$1" "$service_name::$1"; do
|
for f in "service::$1" "$1"; do
|
||||||
is_function "$f" && return 0
|
is_function "$f" && return 0
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ if_service_action() {
|
||||||
}; readonly -f if_service_action
|
}; readonly -f if_service_action
|
||||||
|
|
||||||
run_service_action() {
|
run_service_action() {
|
||||||
for f in "$service_name::$1" "$1"; do
|
for f in "service::$1" "$1"; do
|
||||||
is_function "$f" && {
|
is_function "$f" && {
|
||||||
"$f"; return $?
|
"$f"; return $?
|
||||||
}
|
}
|
||||||
|
@ -767,11 +767,6 @@ flag_edit_service && { edit; die $?; }
|
||||||
service_name = "${1##*/}"
|
service_name = "${1##*/}"
|
||||||
readonly service_name
|
readonly service_name
|
||||||
|
|
||||||
# Enforce service_name to conform to BASH's name constraints
|
|
||||||
[[ $service_name =~ ^[a-zA-Z_][a-zA-Z0-9_]+?$ ]] || {
|
|
||||||
die 77 "Invalid service name: '$service_name'"
|
|
||||||
}
|
|
||||||
|
|
||||||
# These depend on the service_name and make little sense to reconfigure.
|
# These depend on the service_name and make little sense to reconfigure.
|
||||||
service_ready_flag := "$rundir/$service_name.ready"
|
service_ready_flag := "$rundir/$service_name.ready"
|
||||||
service_enabled_flag := "$rundir/$service_name.enabled"
|
service_enabled_flag := "$rundir/$service_name.enabled"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user