24 lines
455 B
Bash
24 lines
455 B
Bash
|
load_machine_config() {
|
||
|
directory="$1"
|
||
|
path="${HOME}/${directory}/$(hostname).sh"
|
||
|
|
||
|
# shellcheck source=/dev/null
|
||
|
[ -x "$path" ] && . "$path"
|
||
|
|
||
|
unset directory
|
||
|
unset path
|
||
|
}
|
||
|
|
||
|
load_config_directory() {
|
||
|
directory="$1"
|
||
|
path="${HOME}/${directory}"
|
||
|
|
||
|
if [ -d "${path}" ]; then
|
||
|
for f in "${path}/"?*.sh; do
|
||
|
# shellcheck source=/dev/null
|
||
|
[ -x "$f" ] && . "$f"
|
||
|
done
|
||
|
unset f
|
||
|
fi
|
||
|
}
|