tool=$(cd "$tool"; cd -)
sudo ln -fns "$tool"/vm_hosted /usr/local/sbin/
sudo ln -fns "$tool"/vm_hosted /usr/local/sbin/vm
+ sudo install -m 770 /dev/stdin .git/hooks/post-update <<-EOF
+ #!/bin/sh -efux
+ case \$1 in
+ (refs/remotes/master)
+ cd ..
+ git --git-dir=\$PWD/.git checkout -f -B master remotes/master
+ git --git-dir=\$PWD/.git clean -f -d -
+ ;;
+ esac
+ EOF
)
}
rule_git_reset () {
/etc/apache2/site.d/"$site" \
/home/www/etc/apache2/"$site"
test -e /home/www/pub/"$site" ||
- sudo install -d -m 770 -o www."$site" -g www."$site" \
+ sudo install -d -m 2770 -o www."$site" -g www."$site" \
/home/www/pub/"$site"
getent passwd www."$site" >/dev/null ||
sudo adduser \
sudo install -d -m 750 -o www -g www \
/home/www/etc
sudo install -d -m 1771 -o www-data -g www-data \
- /home/www/pub \
+ /home/www/pub
sudo install -d -m 1771 -o log.www -g log.www \
/home/www/log
}