Skip to content

Instantly share code, notes, and snippets.

@doingweb
Created November 21, 2016 02:38
Show Gist options
  • Save doingweb/c14b8a9fe6dc1c6ce8b9b23523c7d0c9 to your computer and use it in GitHub Desktop.
Save doingweb/c14b8a9fe6dc1c6ce8b9b23523c7d0c9 to your computer and use it in GitHub Desktop.
Git post-receive hook for remote configuration of OpenHAB
#!/bin/sh
etc_dir=/etc/openhab
config_dir=configurations
rm -rf $etc_dir/$config_dir
GIT_WORK_TREE=$etc_dir git checkout -f HEAD $config_dir
chgrp -R openhab $etc_dir/$config_dir
chmod -R g+w $etc_dir/$config_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment