Skip to content

Commit

Permalink
feat: for fresh installs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhobson authored Oct 22, 2024
1 parent 17b3c6b commit 77f1eb7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Sergen.Main/Resources/Install.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
#!/bin/bash
cd "$(dirname "$0")"

# Stop the service if it is running
systemctl stop Sergen.service
rm /lib/systemd/system/Sergen.service

# Check if the systemd service file exists before removing it
if [ -f /lib/systemd/system/Sergen.service ]; then
rm /lib/systemd/system/Sergen.service
echo "Removed existing Sergen.service file."
else
echo "Sergen.service file does not exist, skipping removal."
fi

# Copy the new service file
cp Sergen.service /lib/systemd/system/Sergen.service

# Ensure the target directory exists
mkdir -p /opt/Sergen

# Copy all files to /opt/Sergen
yes | cp -rf ../* /opt/Sergen

# Reload systemd services and start the service
systemctl daemon-reload
systemctl start Sergen.service

0 comments on commit 77f1eb7

Please sign in to comment.