From a54579cf3d27a288e342f94eb783c627bf078406 Mon Sep 17 00:00:00 2001 From: wpa-2 <9049886+wpa-2@users.noreply.github.com> Date: Sun, 2 Feb 2025 19:35:51 +0000 Subject: [PATCH] Delete scripts/backup.sh Signed-off-by: wpa-2 <9049886+wpa-2@users.noreply.github.com> --- scripts/backup.sh | 67 ----------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100755 scripts/backup.sh diff --git a/scripts/backup.sh b/scripts/backup.sh deleted file mode 100755 index b41d4690..00000000 --- a/scripts/backup.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -usage() { - echo "Usage: backup.sh [-honu] [-h] [-u user] [-n host name or ip] [-o output]" -} - -while getopts "ho:n:u:" arg; do - case $arg in - h) - usage - exit - ;; - n) - UNIT_HOSTNAME=$OPTARG - ;; - o) - OUTPUT=$OPTARG - ;; - u) - UNIT_USERNAME=$OPTARG - ;; - *) - usage - exit 1 - esac -done - -# name of the ethernet gadget interface on the host -UNIT_HOSTNAME=${UNIT_HOSTNAME:-10.0.0.2} -# output backup tgz file -OUTPUT=${OUTPUT:-${UNIT_HOSTNAME}-backup-$(date +%s).tgz} -# username to use for ssh -UNIT_USERNAME=${UNIT_USERNAME:-pi} -# what to backup -FILES_TO_BACKUP="/boot/firmware/cmdline.txt \ - /boot/firmware/config.txt \ - /root/settings.yaml \ - /root/client_secrets.json \ - /root/.api-report.json \ - /root/.ssh \ - /root/.bashrc \ - /root/.profile \ - /home/pi/handshakes \ - /root/peers \ - /etc/modprobe.d/g_ether.conf \ - /etc/pwnagotchi/ \ - /etc/ssh/ \ - /etc/pwnagotchi/log/pwnagotchi.log \ - /etc/pwnagotchi/log/pwnagotchi*.gz \ - /home/pi/.ssh \ - /home/pi/.bashrc \ - /home/pi/.profile \ - /root/.api-report.json \ - /root/.auto-update \ - /root/.bt-tether* \ - /root/.ohc_uploads \ - /root/.wigle_uploads \ - /home/pi/.wpa_sec_uploads" - -ping -c 1 "${UNIT_HOSTNAME}" > /dev/null 2>&1 || { - echo "@ unit ${UNIT_HOSTNAME} can't be reached, make sure it's connected and a static IP assigned to the USB interface." - exit 1 -} - -echo "@ backing up $UNIT_HOSTNAME to $OUTPUT ..." -# shellcheck disable=SC2029 -ssh "${UNIT_USERNAME}@${UNIT_HOSTNAME}" "sudo find ${FILES_TO_BACKUP} -type f -print0 | xargs -0 sudo tar cv" | gzip -9 > "$OUTPUT"