Skip to content

Instantly share code, notes, and snippets.

@Wqrld
Last active May 16, 2024 16:21
Show Gist options
  • Save Wqrld/2c7bc969074b03d47255e7c70e42ff41 to your computer and use it in GitHub Desktop.
Save Wqrld/2c7bc969074b03d47255e7c70e42ff41 to your computer and use it in GitHub Desktop.
if [ ! -f /usr/bin/sshpass ]; then
NEEDRESTART_MODE=l apt -y install sshpass
fi
if [ ! -f /usr/bin/fzy ]; then
NEEDRESTART_MODE=l apt -y install fzy
fi
if [ ! -f /usr/bin/borg ]; then
NEEDRESTART_MODE=l apt -y install borgbackup
fi
echo "Enter SSH Password"
read SSHPASS
echo "Enter repo name"
read REPO
file=$(sshpass -p $SSHPASS borg list $REPO | fzy | awk '{print $1}'); echo $file
mkdir -p /mnt/borg
borg mount $REPO::$file /mnt/borg
server=$(ls /mnt/borg/srv/daemon-data/ | fzy)
cd /mnt/borg/srv/daemon-data/$server
echo "starting new shell, type exit, or 'borg umount /mnt/borg' to automatically unmount"
bash
borg umount /mnt/borg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment