migration/deno-v4 #1
@@ -340,6 +340,14 @@ fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Update systemd service file if migrating from v3
|
||||
if [ $SERVICE_WAS_RUNNING -eq 1 ] && [ $OLD_NODE_INSTALL -eq 1 ]; then
|
||||
echo "Updating systemd service file for v4..."
|
||||
$BINARY_PATH service enable > /dev/null 2>&1
|
||||
echo "Service file updated."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Restart service if it was running before update
|
||||
if [ $SERVICE_WAS_RUNNING -eq 1 ]; then
|
||||
echo "Restarting NUPST service..."
|
||||
|
@@ -15,17 +15,17 @@ export class NupstSystemd {
|
||||
|
||||
/** Template for the systemd service file */
|
||||
private readonly serviceTemplate = `[Unit]
|
||||
Description=Node.js UPS Shutdown Tool for Multiple UPS Devices
|
||||
Description=NUPST - Deno-powered UPS Monitoring Tool
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/nupst/bin/nupst daemon-start
|
||||
ExecStart=/usr/local/bin/nupst service start-daemon
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
User=root
|
||||
Group=root
|
||||
Environment=PATH=/usr/bin:/usr/local/bin
|
||||
Environment=NODE_ENV=production
|
||||
WorkingDirectory=/tmp
|
||||
WorkingDirectory=/opt/nupst
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
Reference in New Issue
Block a user