Skip to content

Instantly share code, notes, and snippets.

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 \
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 build
export JAVA_HOME=/usr/lib/jvm/default-java
# line duplicated on purpose; first time is expected to fail according to docs
build/ checkout dldeps build || true
build/ checkout dldeps build
# start html5 validator automatically
mkdir /etc/service/validator
cat > /etc/service/validator/run <<EOF
cd ~validator
sudo -u validator build/ run
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