install: mkfifo only if the file is not fifo yet
authorPetr Baudis <pasky@suse.cz>
Wed, 7 Mar 2012 11:31:02 +0000 (7 12:31 +0100)
committerPetr Baudis <pasky@suse.cz>
Wed, 7 Mar 2012 11:31:02 +0000 (7 12:31 +0100)
This avoids the need to re-chown file after each install.

install.sh

index 63d4b1c..c8ad84b 100755 (executable)
@@ -35,7 +35,7 @@ if [ -n "$cfg_mirror" ]; then
 fi
 if [ -n "$cfg_push" -a "$cfg_permission_control" = "Group" ]; then
        echo "Creating FIFO for fixupd: $cfg_fixup_queue"
-       mkfifo "$cfg_fixup_queue"
+       [ -p "$cfg_fixup_queue" ] || mkfifo "$cfg_fixup_queue"
        chown "$cfg_cgi_user""$owngroup" "$cfg_fixup_queue" ||
                echo "WARNING: Cannot chown $cfg_cgi_user.$cfg_owning_group $cfg_fixup_queue"
        echo "--- Remember to copy $cfg_basedir/fixupd/ to /root and start fixupd.sh as root"