25 lines
549 B
Bash
Executable File
25 lines
549 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
wd="$(realpath "$(dirname "$(realpath -s "$0")")/.tmp")"
|
|
git_url_prefix="https://git.zio.sh/zio/rootfs/raw/branch/main"
|
|
|
|
function fetch() {
|
|
url="$1"
|
|
output="$2"
|
|
curl -L -s -o "$output" "$url"
|
|
}
|
|
|
|
mkdir -p "$wd"
|
|
mkdir -p "$wd/helpers"
|
|
|
|
fetch "$git_url_prefix/usr/local/bin/sh.zio.backup" "$wd/backup.sh"
|
|
fetch "$git_url_prefix/usr/local/libexec/zio/helpers/bash.sh" "$wd/helpers/bash.sh"
|
|
|
|
chmod +x "$wd/backup.sh"
|
|
chmod +x "$wd/helpers/bash.sh"
|
|
|
|
export ZIO_HELPERS_DIR="$wd/helpers"
|
|
. "$wd/backup.sh" $@
|
|
|
|
rm -rf "$wd"
|