Add remote.sh
This commit is contained in:
parent
811e75f2bb
commit
febb2f3688
22
remote.sh
Normal file
22
remote.sh
Normal file
@ -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 <command>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Call the function with the provided command
|
||||||
|
execute_remote "$1"
|
Loading…
x
Reference in New Issue
Block a user