Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash -e
apt-get update
apt-get -y install sudo apache2 w3c-markup-validator git default-jdk python \
daemontools-run
adduser --system --group --shell /bin/false --disabled-login \
--home /opt/html5-validator validator
# set up html5 validator
sudo -u validator sh -e <<EOF
cd ~
git clone https://github.com/validator/build.git build
export JAVA_HOME=/usr/lib/jvm/default-java
# line duplicated on purpose; first time is expected to fail according to docs
build/build.py checkout dldeps build || true
build/build.py checkout dldeps build
EOF
# start html5 validator automatically
mkdir /etc/service/validator
cat > /etc/service/validator/run <<EOF
#!/bin/sh
cd ~validator
sudo -u validator build/build.py run
EOF
chmod +x /etc/service/validator/run
# enable html5 validator service
sed -i 's/#HTML5 = /HTML5 = /' /etc/w3c/validator.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment