2022-06-12 16:57:12 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
export LOG=./logs/hugo-server.log
|
|
|
|
|
2024-09-08 11:54:48 +00:00
|
|
|
if [ -n "$1" ]; then
|
2022-06-12 16:57:12 +00:00
|
|
|
if [[ "$1" == "start" ]]; then
|
|
|
|
hugo server -D --disableFastRender --enableGitInfo -v --debug > $LOG 2>&1 &
|
|
|
|
echo "Server started on $(pidof hugo)"
|
|
|
|
elif [[ "$1" == "stop" ]]; then
|
2024-09-08 11:54:48 +00:00
|
|
|
kill -9 "$(pidof hugo)"
|
2022-06-12 16:57:12 +00:00
|
|
|
elif [[ "$1" == "status" ]]; then
|
|
|
|
pid=$(pidof hugo)
|
2024-09-08 11:54:48 +00:00
|
|
|
if [ -n "$pid" ]; then
|
2022-06-12 16:57:12 +00:00
|
|
|
echo "Hugo Server Active. PID: ${pid}"
|
|
|
|
else
|
|
|
|
echo "Hugo Server Is Inactive."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "You can 'start' or 'stop' the server, or get the 'status'."
|
|
|
|
exit 1
|
|
|
|
fi
|