diff --git a/README.adoc b/README.adoc index 1da535a..6ef6403 100644 --- a/README.adoc +++ b/README.adoc @@ -1,6 +1,7 @@ = Android Borgmatic Setup == Installation .... +apt-get update apt-get install -y wget wget https://gitea.austenwares.com/stonewareslord/android-borgmatic-setup/archive/master.tar.gz tar -xf master.tar.gz @@ -9,5 +10,5 @@ cd android-borgmatic-setup .... .... -apt-get install -y wget && wget https://gitea.austenwares.com/stonewareslord/android-borgmatic-setup/archive/master.tar.gz && tar -xf master.tar.gz && cd android-borgmatic-setup && ./init.sh +apt-get update && apt-get install -y wget && wget https://gitea.austenwares.com/stonewareslord/android-borgmatic-setup/archive/master.tar.gz && tar -xf master.tar.gz && cd android-borgmatic-setup && ./init.sh .... diff --git a/init.sh b/init.sh index 2dc9d53..8e8fe5e 100755 --- a/init.sh +++ b/init.sh @@ -12,13 +12,15 @@ die() { exit 1 } install_requirements() { + termux-setup-storage + LAST_UPDATE="$(stat -c %Y /data/data/com.termux/files/usr/var/cache/apt/pkgcache.bin)" NOW="$(date +%s)" if ((NOW - LAST_UPDATE > 60 * 60 * 24)); then apt-get update fi apt-get upgrade -y - apt-get install -y python screen wget openssh + apt-get install -y python screen wget openssh clang if ! command -v borgmatic 2>/dev/null || ! command -v borg 2>/dev/null; then get_debs @@ -28,6 +30,10 @@ install_requirements() { if [[ ! -e ~/.ssh/id_ed25519 ]]; then ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_ed25519 fi + + if ! command -v borgmatic; then + pip3 install borgmatic + fi } get_debs() { wget "$DEBS_URL" -O "$DEBS_FNAME" @@ -64,7 +70,7 @@ install_templates() { mkdir -p "$HOME/.config/borgmatic" cp "$SCRIPT_DIR/config.yaml" "$BORGMATIC_CONFIG_FILE" - set -x + set +x replace "$BORGMATIC_CONFIG_FILE" REPO "user@files:$(hostname)" "What is your repository?" replace "$BORGMATIC_CONFIG_FILE" CROSS_FILESYSTEM "true" "Cross filesystem?" replace "$BORGMATIC_CONFIG_FILE" REMOTE_PATH "borg1" "Remote borg command?"