autostart-manage/autoinstall/archive_command.sh

19 lines
290 B
Bash
Raw Normal View History

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