From 3c3f407e7df67445e924ef04ed7e1d4a013d2b6f Mon Sep 17 00:00:00 2001 From: James Thistlewood Date: Sat, 20 Mar 2021 21:02:29 +0000 Subject: [PATCH] make install script safer --- linux/plugins/README.md | 2 +- linux/plugins/install.sh | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/linux/plugins/README.md b/linux/plugins/README.md index 540f9c6b3..a80a1ae0c 100644 --- a/linux/plugins/README.md +++ b/linux/plugins/README.md @@ -24,4 +24,4 @@ python3 main.py This will by default run at `localhost:3141`, but feel free to change the port by adding the `--port` flag. -Then just visit `localhost:3141` (or your specified) port to view the web interface! +Then just visit `localhost:3141` (or your specified port) to view the web interface! diff --git a/linux/plugins/install.sh b/linux/plugins/install.sh index eadbe64da..4730a8c28 100755 --- a/linux/plugins/install.sh +++ b/linux/plugins/install.sh @@ -1,4 +1,16 @@ #!/usr/bin/env bash cp read_util "../server" -cp ets2-telemetry-lin.so "$HOME/.local/share/Steam/steamapps/common/Euro Truck Simulator 2/bin/linux_x64/plugins" + +if [ ! -d "$HOME/.local/share/Steam/steamapps/common/Euro Truck Simulator 2/bin/linux_x64/" ]; then + echo "WARN: Could not find ETS2 installation! Please manually move ets2-telemetry-lin.so to your plugins directory." + echo "Installed with partial success" + exit 1 +else + mkdir -p "$HOME/.local/share/Steam/steamapps/common/Euro Truck Simulator 2/bin/linux_x64/plugins" + mkdir -p "$HOME/.local/share/Steam/steamapps/common/Euro Truck Simulator 2/bin/linux_x86/plugins" + cp ets2-telemetry-lin.so "$HOME/.local/share/Steam/steamapps/common/Euro Truck Simulator 2/bin/linux_x64/plugins" + cp ets2-telemetry-lin.so "$HOME/.local/share/Steam/steamapps/common/Euro Truck Simulator 2/bin/linux_x86/plugins" +fi + +echo "Installed successfully"