Fix and automate systemd deployment
parent
558898b949
commit
b8c9fe390d
@ -1,8 +1,8 @@
|
|||||||
# /etc/systemd/system/sessioncommunities.service
|
# /etc/systemd/system/sessioncommunities.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Scrape every known source for Session Communities and put the data to a NGINX accessible folder
|
Description=Session Communities aggregator
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/home/session/sessioncommunities.online
|
### User=$USER
|
||||||
User=session
|
### WorkingDirectory=$PROJECT
|
||||||
ExecStart=/usr/bin/sh -c "/usr/bin/php php/update-all.php --verbose --archive --no-color 2>&1 | /usr/bin/tee sessioncommunities.log"
|
ExecStart=/usr/bin/sh -c "/usr/bin/php php/update-all.php --verbose --archive --no-color 2>&1 | /usr/bin/tee sessioncommunities.log"
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "$(dirname "$0")" || exit 1
|
||||||
|
mydir="$(pwd)"
|
||||||
|
while ! [ -f ".phpenv.php" ]; do cd ..; done
|
||||||
|
project="$(pwd)"
|
||||||
|
/bin/cp "$mydir/sessioncommunities.timer" "/etc/systemd/system/" || exit 1
|
||||||
|
/bin/sed \
|
||||||
|
-e "/^### /s/\$USER/$USER/g" \
|
||||||
|
-e "/^### /s,\$PROJECT,$project,g" \
|
||||||
|
-e "s/^### //g" \
|
||||||
|
etc/systemd/sessioncommunities.service \
|
||||||
|
> /etc/systemd/system/sessioncommunities.service
|
||||||
|
/bin/systemctl daemon-reload
|
Loading…
Reference in New Issue