Last active
August 29, 2015 14:27
-
-
Save oerdnj/c68327f8c7a5725645ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do_tmpfiles() { | |
local type path mode user group | |
if [ -r "$1" ]; then | |
if [ -x /bin/systemd-tmpfiles ]; then | |
/bin/systemd-tmpfiles --create "$1" | |
else | |
while read type path mode user group; do | |
case "$type" in | |
d) | |
mkdir -p "$path"; | |
chmod "$mode" "$path"; | |
chown "$user:$group" "$path"; | |
;; | |
*) | |
log_warning_msg "tmpfile.d type '$type' is not supported yet" | |
;; | |
esac | |
done < "$1" | |
else | |
log_warning_msg "tmpfiles.d file '$1' doesn't exist or is not readable" | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment