diff options
Diffstat (limited to 'Propellor/Property/Cmd.hs')
| -rw-r--r-- | Propellor/Property/Cmd.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Propellor/Property/Cmd.hs b/Propellor/Property/Cmd.hs index b1c9435a..1f668daf 100644 --- a/Propellor/Property/Cmd.hs +++ b/Propellor/Property/Cmd.hs @@ -2,6 +2,7 @@ module Propellor.Property.Cmd ( cmdProperty, cmdProperty', scriptProperty, + userScriptProperty, serviceRunning, ) where @@ -39,6 +40,13 @@ scriptProperty script = cmdProperty "sh" ["-c", shellcmd] where shellcmd = intercalate " ; " ("set -e" : script) +-- | A property that can satisfied by running a series of shell commands, +-- as user (staring in their home directory). +userScriptProperty :: UserName -> [String] -> Property +userScriptProperty user script = cmdProperty "su" ["-c", shellcmd, user] + where + shellcmd = intercalate " ; " ("set -e" : "cd" : script) + -- | Ensures that a service is running. -- -- Note that due to the general poor state of init scripts, the best |
