remove VPS cruft

This commit is contained in:
Joey Hess 2014-03-30 15:14:36 -04:00
parent 34fb53e8cc
commit 8d31a6226a
3 changed files with 14 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
dist/*
propellor
tags

View File

@ -64,4 +64,7 @@ cleanCloudAtCost hostname = propertyList "cloudatcost cleanup"
, "/etc/default/grub" `File.containsLine` "GRUB_DISABLE_LINUX_UUID=true"
`onChange` cmdProperty "update-grub" []
`onChange` cmdProperty "update-initramfs" [Param "-u"]
-- Cruft
, File.notPresent "/etc/rc.local"
, File.notPresent "/etc/init.d/S97-setup.sh"
]

View File

@ -1,6 +1,9 @@
module Property.File where
import System.Directory
import Property
import Utility.Directory
{- Replaces all the content of a file. -}
hasContent :: FilePath -> [Line] -> Property
@ -20,3 +23,8 @@ f `containsLine` l = FileProperty (f ++ " contains:" ++ l) f go
- file will be written. -}
lacksLine :: FilePath -> Line -> Property
f `lacksLine` l = FileProperty (f ++ " remove: " ++ l) f (filter (/= l))
{- Note: Does not remove symlinks or non-plain-files. -}
notPresent :: FilePath -> Property
notPresent f = check (doesFileExist f) $ IOProperty (f ++ " not present") $
makeChange $ nukeFile f