summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xserver/lib/ogfunctions.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/lib/ogfunctions.sh b/server/lib/ogfunctions.sh
index 4b61166b..c630e41f 100755
--- a/server/lib/ogfunctions.sh
+++ b/server/lib/ogfunctions.sh
@@ -84,6 +84,12 @@ EOT
rm -f "$MYCNF"
}
+# Returns parent process name (program or script)
+function getcaller () {
+ basename "$(COLUMNS=200 ps hp $PPID -o args | \
+ awk '{if ($1~/bash/ && $2!="") { print $2; }
+ else { sub(/^-/,"",$1); print $1; } }')"
+}
### Meta-functions and private functions.