From 22e7a43a529d72bd355daf041c1682db69ea2118 Mon Sep 17 00:00:00 2001 From: Ducky Date: Tue, 22 Aug 2023 00:46:52 +0100 Subject: [PATCH] init --- .gitignore | 2 ++ sh.zio.backup | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .gitignore create mode 100755 sh.zio.backup 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"