aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/package.lisp1
-rw-r--r--src/property.lisp7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/package.lisp b/src/package.lisp
index 07c87f7..077a5ff 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -154,6 +154,7 @@
#:push-hostattrs
#:pushnew-hostattrs
#:get-hostname
+ #:get-short-hostname
#:require-data
#:failed-change
#:assert-euid-root
diff --git a/src/property.lisp b/src/property.lisp
index 52c040d..8b38db9 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -525,6 +525,13 @@ being applied.
Called by property subroutines."
(get-hostattrs-car :hostname host))
+(defun get-short-hostname (&optional (host *host*))
+ "Get the short hostname of HOST, defaulting to the host to which properties
+are being applied.
+
+Called by property subroutines."
+ (car (split-string (get-hostattrs-car :hostname host) :separator ".")))
+
;;;; :APPLY subroutines