autostart-manage/autoinstall/env_command.sh

18 lines
294 B
Bash
Raw Permalink Normal View History

2024-01-09 15:48:11 +00:00
#!/usr/bin/env bash
target=${args[target]:?}
template=${args[template]:?}
if [ ! -f "$target" ]
then
echo "Installing env-template $template to $target"
target_dir=$(dirname "$target")
mkdir -p "$target_dir"
cd "$target_dir" || exit 1
envsubst < "$template" > "$target"
_run_hook
fi