From ed10318d3760b56e57d5e1bef04ab57761ab8bd1 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Tue, 12 Mar 2013 23:52:48 -0400 Subject: enable executing shell functions by invoking common directly. if you want to just launch a subshell that invokes a single function (e.g. foobar) from monkeysphere's common source, you should now be able to do so with: ${SYSSHAREDIR}/common foobar --- src/share/common | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 src/share/common (limited to 'src/share') diff --git a/src/share/common b/src/share/common old mode 100644 new mode 100755 index f9be05a..508b064 --- a/src/share/common +++ b/src/share/common @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # -*-shell-script-*- # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant) @@ -997,3 +998,7 @@ report_cruft() { printf "The directories above are backups left over from a monkeysphere transition.\nThey may contain copies of sensitive data (host keys, certifier lists), but\nthey are no longer needed by monkeysphere.\nYou may remove them at any time.\n\n" | log info fi } + +if [ -n "$1" ] && [ "$(type -t "$1" || true)" = "function" ]; then + "$@" +fi -- cgit v1.2.3