add --git flag to ssh script

This commit is contained in:
2025-12-11 10:41:46 +02:00
parent 646a278169
commit 3771d8c815

View File

@@ -3,8 +3,8 @@ copyEnv() {
echo "Copied $1"
}
# Check for --db flag
if [ "$1" = "--db" ]; then
# Proxy database to localhost
copyEnv DB_DATABASE
copyEnv DB_PASSWORD
copyEnv DB_USERNAME
@@ -12,7 +12,11 @@ if [ "$1" = "--db" ]; then
echo "Local port 3306 -> Remote MySQL port 3306"
sshpass -p "$SERVER_PASSWORD" \
ssh -L 3306:localhost:3306 $SERVER_USER@$SERVER_HOST
elif [ "$1" = "--git" ]; then
# Run lazygit on server
sshpass -p "$SERVER_PASSWORD" \
ssh -t $SERVER_USER@$SERVER_HOST \
"cd $SERVER_PATH && ./lazygit"
else
sshpass -p "$SERVER_PASSWORD" \
ssh -t $SERVER_USER@$SERVER_HOST \