summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorSean Whitton2018-06-15 16:44:05 +0100
committerJoey Hess2018-06-16 07:46:51 -0400
commit87cfaae69f29e156a7bcb5b1924b806056c4401c (patch)
tree5c4af2ed600a0a2c86d2cc3f654ecf179f079a6d /src/Propellor
parent6bbad0c9411872aa01af2babd54436590a5e3f33 (diff)
add EtcDefault.set
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/EtcDefault.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Propellor/Property/EtcDefault.hs b/src/Propellor/Property/EtcDefault.hs
new file mode 100644
index 00000000..0bda5c64
--- /dev/null
+++ b/src/Propellor/Property/EtcDefault.hs
@@ -0,0 +1,17 @@
+-- | Maintainer: Sean Whitton <spwhitton@spwhitton.name>
+
+module Propellor.Property.EtcDefault (
+ EtcDefaultFile,
+ set,
+) where
+
+import Propellor.Base
+import Propellor.Property.ConfFile
+
+-- | The name of a file in </etc/default>, without the </etc/default> prefix.
+-- E.g. @useradd@.
+type EtcDefaultFile = String
+
+-- | Set a key=value pair in a file in </etc/default>.
+set :: EtcDefaultFile -> ShellKey -> String -> Property UnixLike
+set f key value = containsShellSetting ("/etc/default" </> f) (key, value)