35 lines
990 B
Python
35 lines
990 B
Python
import paramiko
|
|
|
|
ssh = paramiko.SSHClient()
|
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
ssh.connect("140.44.44.80", username="root", key_filename=r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet", timeout=10)
|
|
|
|
script = """#!/bin/bash
|
|
export DISPLAY=:1
|
|
export WINEPREFIX=/home/nobody/.fs_server
|
|
export WINEARCH=win64
|
|
export WINEDLLOVERRIDES="mscoree=d"
|
|
export WINEDEBUG=-all
|
|
export USER=nobody
|
|
|
|
echo "1. Booting wineprefix..."
|
|
wineboot -u
|
|
wineserver -w
|
|
echo "2. Wineprefix booted."
|
|
|
|
echo "3. Starting Setup.exe /SILENT /NOCANCEL..."
|
|
wine /opt/fs25/install/Setup.exe /SILENT /NOCANCEL
|
|
wineserver -w
|
|
echo "4. Setup.exe completed with code $?!"
|
|
"""
|
|
|
|
sftp = ssh.open_sftp()
|
|
with sftp.open("/opt/game-servers/fs25/do_install.sh", "w") as f:
|
|
f.write(script)
|
|
sftp.close()
|
|
|
|
ssh.exec_command("chmod 777 /opt/game-servers/fs25/do_install.sh; docker cp /opt/game-servers/fs25/do_install.sh gameseed-farming-simulator-25:/opt/fs25/do_install.sh")
|
|
ssh.close()
|
|
print("Uploaded do_install.sh")
|
|
|