Compare commits

..

2 Commits

Author SHA1 Message Date
fbt
7c584eb8ee service path
Signed-off-by: fbt <fbt@fleshless.org>
2021-01-24 19:36:37 +03:00
fbt
608e7d4d9d Why
Signed-off-by: fbt <fbt@fleshless.org>
2020-12-03 19:14:21 +03:00

17
ssm
View File

@ -677,14 +677,6 @@ case "$0" in
(*) _self = "$PWD/$0";; (*) _self = "$PWD/$0";;
esac esac
# Warn the user of deprecated stuff.
for p in "/etc/ssm/init.d" "$XDG_CONFIG_HOME/ssm/init.d"; do
if [[ -d "$p" ]]; then
printf 'WARNING: `%s` was renamed to `%s`! Please move your scripts accordingly!\n' "$p" "${p%init.d}services" >&2
service_path += "$p"
fi
done
# Source the config # Source the config
if cfg_file is file; then if cfg_file is file; then
source "$cfg_file" || die 37 "Failed to load config: $cfg_file" source "$cfg_file" || die 37 "Failed to load config: $cfg_file"
@ -746,7 +738,11 @@ for d in "$rundir" "$rundir/current" "$logdir"; do
done done
# Common service path # Common service path
service_path += "$XDG_CONFIG_HOME/ssm/services" '/etc/ssm/services' "$rundir/services" "$usrdir/services" if (( UID )); then
service_path += "$rundir/current" "$XDG_CONFIG_HOME/ssm/services" '/etc/ssm/services' "$usrdir/services"
else
service_path += "$rundir/current" '/etc/ssm/services' "$usrdir/services"
fi
# Special actions # Special actions
if flag_list_services; then if flag_list_services; then
@ -781,12 +777,13 @@ if [[ $service_name == /* ]]; then
service_config = "$service_name" service_config = "$service_name"
service_name = "${service_name##*/}" service_name = "${service_name##*/}"
else else
for i in "$service_config_current" "${service_path[@]/%//$service_name}"; do for i in "${service_path[@]/%//$service_name}"; do
[[ -f "$i" ]] && { [[ -f "$i" ]] && {
service_config = "$i" service_config = "$i"
break break
} }
done done
fi fi
# We really don't want this overriden # We really don't want this overriden