From 4c84c819f57ed915f11e0e3209bb65982ef14ed3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 7 Feb 2011 17:53:53 +0100 Subject: [PATCH] [type] NEW: issue Signed-off-by: Nico Schottelius --- conf/types/issue/README | 1 + conf/types/issue/files/archlinux | 2 ++ conf/types/issue/files/default | 2 ++ conf/types/issue/init | 34 ++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 conf/types/issue/README create mode 100644 conf/types/issue/files/archlinux create mode 100644 conf/types/issue/files/default create mode 100755 conf/types/issue/init diff --git a/conf/types/issue/README b/conf/types/issue/README new file mode 100644 index 00000000..f7bbde5c --- /dev/null +++ b/conf/types/issue/README @@ -0,0 +1 @@ +Manage /etc/issue diff --git a/conf/types/issue/files/archlinux b/conf/types/issue/files/archlinux new file mode 100644 index 00000000..261f977a --- /dev/null +++ b/conf/types/issue/files/archlinux @@ -0,0 +1,2 @@ +Arch Linux \r (\n) (\l) (cdist automated) + diff --git a/conf/types/issue/files/default b/conf/types/issue/files/default new file mode 100644 index 00000000..f8314de9 --- /dev/null +++ b/conf/types/issue/files/default @@ -0,0 +1,2 @@ +Some OS \r (\n) (\l) (cdist automated) + diff --git a/conf/types/issue/init b/conf/types/issue/init new file mode 100755 index 00000000..723a1378 --- /dev/null +++ b/conf/types/issue/init @@ -0,0 +1,34 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# + +destination=/etc/issue + +case "$__cdist_explorer_os" in + archlinux) + source="$(__cdist_type_mydir)/files/archlinux" + ;; + *) + source="$(__cdist_type_mydir)/files/default" + ;; +esac + +# FIXME: replace id with $destination post-1.0 +__file etc-issue --source "$source" --destination "$destination"