summaryrefslogtreecommitdiff
blob: 55f46f0791a5148c4e19be710927302b0e25f950 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# Copyright 2024-2024, Gentoo Foundation
# SPDX-License-Identifier: BSD-2-Clause
FIFO=$1
FIFO_OWNER=$2
FIFO_PERMS=$3
if [ ! -e "${FIFO}" ]; then
	mkfifo "$FIFO" || exit 1
fi
if [ -p "${FIFO}" ]; then
	chown "$FIFO_OWNER" "$FIFO" || exit 1
	chmod "$FIFO_PERMS" "$FIFO" || exit 1
else
	echo "${FIFO} is not a valid FIFO!" 1>&2
	exit 1
fi
exit 0