36 lines
915 B
Python
36 lines
915 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)
|
|
|
|
commands = """
|
|
set -e
|
|
mkdir -p /opt/game-servers/fs25/{install,dlc,docs,wine}
|
|
|
|
# Link files from ISO to install dir
|
|
cd /opt/game-servers/fs25/install
|
|
rm -rf *
|
|
for f in /mnt/storage-games/installers/fs25/iso/*; do
|
|
ln -sf "$f" .
|
|
done
|
|
ln -sf Setup.exe FarmingSimulator2025.exe
|
|
ln -sf Setup.exe FarmingSimulator25.exe
|
|
|
|
# Copy DLCs to dlc dir
|
|
cd /opt/game-servers/fs25/dlc
|
|
cp -u /mnt/storage-games/installers/fs25/*.exe . 2>/dev/null || true
|
|
|
|
# Set permissions
|
|
chmod -R 777 /opt/game-servers/fs25
|
|
|
|
ls -la /opt/game-servers/fs25/install
|
|
ls -la /opt/game-servers/fs25/dlc
|
|
"""
|
|
|
|
stdin, stdout, stderr = ssh.exec_command(commands)
|
|
print(stdout.read().decode())
|
|
print(stderr.read().decode())
|
|
ssh.close()
|
|
|