commit 22e7a43a529d72bd355daf041c1682db69ea2118 Author: Ducky Date: Tue Aug 22 00:46:52 2023 +0100 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..29ea3dd --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +/.tmp diff --git a/sh.zio.backup b/sh.zio.backup new file mode 100755 index 0000000..f2e5b83 --- /dev/null +++ b/sh.zio.backup @@ -0,0 +1,24 @@ +#!/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"