Skip to content

Commit c8574e4

Browse files
akirilovakirilov
authored andcommitted
Minor fixes to squash into the PR
1 parent 4b8cfbb commit c8574e4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

UIMod/onboard_bundled/scripts/autostart.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23

34
# Check if running as root to prevent installing a service as root
45
if [[ $(id -u) = 0 ]]; then
@@ -17,14 +18,15 @@ if [[ -z "$BASEDIR" || ! -d "$BASEDIR" ]]; then
1718
fi
1819

1920
# Find the last modified SSUI binary if multiple exist
20-
SSUI_BINARY=$(ls -t $BASEDIR/StationeersServerControlv* 2>/dev/null | head -n 1 | cut -c 1-)
21+
SSUI_BINARY=$(ls -t $BASEDIR/StationeersServerControlv* 2>/dev/null | head -n 1)
2122
if [[ -z "$SSUI_BINARY" || ! -x "$SSUI_BINARY" ]]; then
2223
echo "Error: Could not find executable StationeersServerControl binary in $BASEDIR."
2324
exit 1
2425
fi
2526

2627
# If the systemd service file already exists, just exec the SSUI binary
2728
if [[ -f /etc/systemd/system/ssui.service ]]; then
29+
echo "Service already installed. Starting SSUI..."
2830
exec "$SSUI_BINARY"
2931
fi
3032

@@ -36,7 +38,7 @@ After=network.target
3638
3739
[Service]
3840
Type=simple
39-
Restart=on-failure
41+
Restart=always
4042
RestartSec=5s
4143
User=$(whoami)
4244
WorkingDirectory=$BASEDIR

0 commit comments

Comments
 (0)