]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.util
Rename fwrite to fappend
[people/ms/network.git] / src / functions / functions.util
index e083f6a7de3515a3a11ad88e46488c1012c9788a..91601de65d6e57d602740670a229f56c6845dd15 100644 (file)
@@ -190,6 +190,19 @@ fwrite() {
        assert isset file
        shift
 
+       if ! print "%s" "$@" > ${file} 2>/dev/null; then
+               error "Could not write to file: ${file}"
+               return ${EXIT_ERROR}
+       fi
+
+       return ${EXIT_OK}
+}
+
+fappend() {
+       local file=${1}
+       assert isset file
+       shift
+
        if [ -e "${file}" ] && [ ! -w "${file}" ]; then
                log ERROR "${file}: No such file"
                return ${EXIT_ERROR}