Skip to content

Commit

Permalink
Adds creation of systemd daemon for running script on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
JanssenSimon committed Oct 20, 2022
1 parent b79a2be commit 049bb50
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion wimp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,24 @@ wimp_create_directories() {
touch ./includes/before.html; touch ./includes/after.html
}
# checks if the watch function is going to be run on startup using systemd
#TODO bug to fix here with path of script
#TODO check if file exists before doing this whole thing
#TODO change this so that it works with multiple directories
wimp_create_daemon() {
echo "TODO create daemon"
touch /etc/systemd/system/wimp.service
echo "[Unit]
Description=Run wimp website generator
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=$(pwd)/wimp
TimeoutStartSec=0
[Install]
WantedBy=default.target" > /etc/systemd/system/wimp.service
systemctl daemon-reload
systemctl enable wimp.service
}
# compiles mardown file in src to html file in public using pandoc
wimp_compile() {
Expand Down

0 comments on commit 049bb50

Please sign in to comment.