# HG changeset patch # User Steve Huston # Date 1610117473 18000 # Node ID 21df76f9457865278835a178d3b4541fb4f27558 # Parent 25e7a79f5ba04e44a253fd6e0636dfd86b80794e Added script/hook for keeping permissions set sanely (ssh complains sometimes) diff -r 25e7a79f5ba0 -r 21df76f94578 bin/dotfile-chmod.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/dotfile-chmod.sh Fri Jan 08 09:51:13 2021 -0500 @@ -0,0 +1,18 @@ +#!/bin/bash +# I wanted this to be a fancy test to see if the files/directories we care +# about were updated and make sure the permissions are set right, but hg +# doesn't tell you enough in the update hook since you could be traversing +# many updates from the current revision to now (unlike commit which gives you +# the earliest part of the transaction to compare against tip). So instead +# we'll just do this on every update, which isn't too costly anyway. +# +# Add to .hg/hgrc: +# [hooks] +# update = ~/bin/dotfile-chmod.sh + +ROOT=`hg root` + +chmod -f 700 $ROOT/.ssh $ROOT/.ssh/sockets +chmod -f 600 $ROOT/.ssh/config + +exit 0