Commit b6f11d7c authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Differentiate SSH configs by platform, hostname & SSH version

parent 447b4d58
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -38,7 +38,11 @@ rule_canonisation() {
make_config() {
	[ -z "${CONFIG-}" ] || return 0

	CONFIG=~/.ssh/.config.`hostname -f`; export CONFIG
	platform && ssh_version

	PLATFORM="$PLATFORM:`hostname -f`:$SSH_MAJOR.$SSH_MINOR"
	PLATFORM_ID=`echo "$PLATFORM" | md5sum | cut -f1 -d' '`
	CONFIG=~/.ssh/.config.$PLATFORM_ID; export CONFIG

	if [ -f "$CONFIG" ] && [ "$CONFIG" -nt ~/.ssh/config ] && (
		! [ -r ~/.ssh/config.local ] || [ "$CONFIG" -nt ~/.ssh/config.local ]
@@ -46,8 +50,6 @@ make_config() {
		return
	fi

	platform && ssh_version

	cat ~/.ssh/config ~/.ssh/config.local 2>/dev/null |
		sed >"$CONFIG" "
			`rule_unix_sockets`