init.d and reverse functions load order
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
8fdd73af45
commit
587ed04903
8
ssm
8
ssm
|
@ -349,7 +349,7 @@ main() {
|
||||||
default XDG_CONFIG_HOME "$HOME/.config"
|
default XDG_CONFIG_HOME "$HOME/.config"
|
||||||
default XDG_RUNTIME_DIR "/run/user/$UID"
|
default XDG_RUNTIME_DIR "/run/user/$UID"
|
||||||
|
|
||||||
service_path=( "$XDG_CONFIG_HOME/ssm/services" )
|
service_path=( "$XDG_CONFIG_HOME/ssm/init.d" )
|
||||||
cfg_path=( "$XDG_CONFIG_HOME/ssm" )
|
cfg_path=( "$XDG_CONFIG_HOME/ssm" )
|
||||||
|
|
||||||
rundir="$XDG_RUNTIME_DIR/ssm"
|
rundir="$XDG_RUNTIME_DIR/ssm"
|
||||||
|
@ -366,8 +366,10 @@ main() {
|
||||||
cfg_path+=( '/etc/ssm/conf.d' )
|
cfg_path+=( '/etc/ssm/conf.d' )
|
||||||
|
|
||||||
# Load custom functions
|
# Load custom functions
|
||||||
for p in "${cfg_path[@]}"; do
|
for (( idx=${#cfg_path[@]}-1; idx>=0; idx-- )); do
|
||||||
for f in "$p/functions"/*; do
|
cfg_dir="${cfg_path[idx]}"
|
||||||
|
|
||||||
|
for f in "$cfg_dir/functions"/*; do
|
||||||
source "$f" || die 9 "Failed to source functions from $f"
|
source "$f" || die 9 "Failed to source functions from $f"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user