Posted by on February 21, 2019, modified on February 21, 2019
start-stop-daemon
啟動Jekyll
#!/bin/bash
ip=0.0.0.0
port=4444
([ -n "$1" ] && [ "$1" == "start" ] ) \
&& ( start-stop-daemon -S -b -m -p /var/run/jekyll.pid \
-d $(pwd) -x $(which bundle) \
-- exec jekyll serve --host ${ip} --port ${port} \
\
)
([ -n "$1" ] && [ "$1" == "stop" ] ) \
&& ( kill -9 $(cat /var/run/jekyll.pid) )