Last active
May 16, 2024 16:21
-
-
Save Wqrld/2c7bc969074b03d47255e7c70e42ff41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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