From febb2f3688dbff52013d929d468833955e431181 Mon Sep 17 00:00:00 2001 From: Sthope Date: Sun, 17 Mar 2024 13:59:15 +0100 Subject: [PATCH] Add remote.sh --- remote.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 remote.sh diff --git a/remote.sh b/remote.sh new file mode 100644 index 0000000..6173903 --- /dev/null +++ b/remote.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# SSH connection details +SSH_USER="username" +SSH_PASSWORD="password" +SMARTTV_IP="remote_ip" +SMARTTV_SCRIPT="python3 smarttv.py" + +# Function to execute Python script remotely +execute_remote() { + local command="$1" + sshpass -p "$SSH_PASSWORD" ssh "$SSH_USER@$SMARTTV_IP" "$SMARTTV_SCRIPT $command" +} + +# Check if a command is provided +if [ $# -eq 0 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Call the function with the provided command +execute_remote "$1"