diff --git a/scripts/astrbot.service b/scripts/astrbot.service new file mode 100644 index 0000000000..fdf891be9f --- /dev/null +++ b/scripts/astrbot.service @@ -0,0 +1,15 @@ +[Unit] +Description=AstrBot Service +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +WorkingDirectory=%h/.local/share/astrbot +ExecStart=/usr/bin/sh -c '/usr/bin/astrbot run || { /usr/bin/astrbot init && /usr/bin/astrbot run; }' +Restart=on-failure +RestartSec=5 +Environment=PYTHONUNBUFFERED=1 + +[Install] +WantedBy=default.target