www.nico.schottelius.org/software/cinit/browse_source/cinit-0.3pre17/bin/cinit-conf.svc.fsck.linux
Nico Schottelius 759b58c293 released cinit-0.3pre17
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-10-05 19:14:52 +02:00

40 lines
713 B
Bash
Executable file

#!/bin/sh
# Nico Schottelius
# cinit: install service: init
# Date: 2005-10-15
#
set -e
. "$(dirname $0)/cinit-conf.read-conf"
if [ $# -ne 3 ]; then
echo "$(basename $0): name device filesystem-type"
exit 1
fi
NAME=$1
DEVICE=$2
FS_TYPE=$3
FSCK="/sbin/fsck.${FS_TYPE}"
if [ ! -f "$FSCK" ]; then
echo "Missing $FSCK, abort."
exit 1
fi
if [ ! -e "${DESTDIR}${DEVICE}" ]; then
echo "Warning: ${DESTDIR}${DEVICE} does not exist."
fi
svcdir="${R_SVC_DIR}/fsck/${NAME}"
if [ -e "$svcdir" ]; then
echo "Error: $svcdir already exists"
exit 1
fi
set -e
"$INSTALL_PROG" "$INSTALL_DIRECTORY" "${svcdir}"
ln -sf "${FSCK}" "${svcdir}/$C_ON"
echo "$DEVICE" > "${svcdir}/$C_ON$C_PARAMS"