Skip to content

Instantly share code, notes, and snippets.

@JohnRipper
Created March 3, 2019 01:32
Show Gist options
  • Save JohnRipper/5a878e8193375c9f38046cc1ac7d9d0b to your computer and use it in GitHub Desktop.
Save JohnRipper/5a878e8193375c9f38046cc1ac7d9d0b to your computer and use it in GitHub Desktop.
from ssh_client import ssh
import sys
import time
for arg in sys.argv:
room = arg
if True:
connection = ssh()
print('Attempting to connnect to pi zero.')
time.sleep(5)
if room:
connection.openShell()
time.sleep(5)
connection.sendShell('screen -R ' + room)
# sends ctrl + x, if the script crashed it closes out, if it didnt or wasnt even running command wont do anything.
connection.sendShell('\x78')
connection.sendShell('. /home/dietpi/venv/tc_bot/bin/activate')
connection.sendShell('python /home/dietpi/tinychat/bot_client.py')
# Wait for python to get its shit together.
time.sleep(5)
connection.sendShell(room)
connection.sendShell('carcinobot')
connection.sendShell('yes')
if room == "templeofvape":
connection.sendShell('johnjripper')
connection.sendShell('')
else:
connection.sendShell('johnnycarcinogen')
connection.sendShell('')
while True:
command = input('$ ')
if command.startswith(" "):
command = command[1:]
connection.sendShell(command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment