forked from DIVD-NL/SecurityMeldpunt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serve
executable file
·18 lines (16 loc) · 826 Bytes
/
serve
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
docker pull mrseccubus/github-pages:latest
while [ 1 ] ; do
if [[ $(uname -a|grep -i microsoft|wc -l) -gt 0 ]]; then
IP=$(ip addr show eth0 |grep "inet "|awk '{ print $2 }'|sed 's/\/.*$//')
echo "*******************************************************************************************"
echo "On WSL2 the docker container is reachable via this url: http://$IP:4000"
echo "*******************************************************************************************"
fi
docker run --volume="$PWD:/root/project:delegated" --entrypoint /bin/bash --publish 4000:4000 -ti mrseccubus/github-pages -c "cd /root/project;rm -rf _site/*;jekyll serve --incremental --host=0.0.0.0 --future 2>&1 |grep -Ev 'rb:[0-9]+: warning'"
set -e
echo 'Press CTRL+C now to quit'
sleep 1
set +e
echo 'Restarting...'
done