1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2025-02-05 14:12:38 -06:00

new: Added open-in-server.sh

This commit is contained in:
Sayantan Santra 2025-01-30 19:55:16 -06:00
parent e7956fcfa5
commit 598328d430
Signed by: SinTan1729
GPG key ID: 0538DD402EA50898
2 changed files with 17 additions and 1 deletions

View file

@ -1,4 +1,4 @@
![Number of scripts](https://img.shields.io/badge/number_of_scripts-47-blue)
![Number of scripts](https://img.shields.io/badge/number_of_scripts-48-blue)
# Random Scripts
This repository is for random scripts I wrote mostly for personal use.

16
open-in-server.sh Normal file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# This script opens supported locations in my server by appropriately changing the
# mount locations for it to work over ssh.
ROOTDIR="$(echo $PWD | cut -d/ -f-2,3)"
if [ "$ROOTDIR" == "/mnt/server" ]; then
ssh -t server-ts-rsync "cd /mnt/storage/$(echo $PWD | cut -d/ -f4-); fish -l"
elif [[ "$ROOTDIR" == "/tank1/personal" || "$ROOTDIR" == "/tank1/media" ]]; then
ssh -t server-ts-rsync "cd $PWD; fish -l"
else
echo "Unsupported directory."
echo "Only /mnt/server/*, /tank1/* are supported."
fi