-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |