summaryrefslogtreecommitdiff
path: root/src/shared/unit-name.c
diff options
context:
space:
mode:
authorMichal Sekletar <msekleta@redhat.com>2012-07-13 15:59:26 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-07-26 10:02:10 +0200
commit29283ea4cf5df20aa0ea9e24e3cb7035bf4c4a04 (patch)
treea5a5f661cb7845f358cc99fbacddbd9ebf392564 /src/shared/unit-name.c
parentac6a4abed3e69daf6795e02fa4be1719ae6ae6ab (diff)
systemd: enable/disable instances of template
https://bugzilla.redhat.com/show_bug.cgi?id=752774
Diffstat (limited to 'src/shared/unit-name.c')
-rw-r--r--src/shared/unit-name.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index fcf5902c78..e8328c321a 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -341,6 +341,18 @@ bool unit_name_is_template(const char *n) {
return p[1] == '.';
}
+bool unit_name_is_instance(const char *n) {
+ const char *p;
+
+ assert(n);
+
+ p = strchr(n, '@');
+ if (!p)
+ return false;
+
+ return p[1] != '.';
+}
+
char *unit_name_replace_instance(const char *f, const char *i) {
const char *p, *e;
char *r, *k;