www.nico.schottelius.org/software/cinit/browse_source/cinit-0.0.8/old/cinit.create.service
Nico Schottelius 423ba10303 import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-09-16 12:53:45 +02:00

40 lines
670 B
Desktop File

#!/bin/sh
# Nico Schottelius
# cinit: create templates
# 2005-05-24
set -e
# init variables
. $(dirname $0)/cinit.read-conf
if [ $# -lt 1 ]; then
echo "`basename $0`: service-name (including category)"
echo " I do create a service for you"
exit 1
fi
BASEDIR=$DESTDIR/$CINIT_DIR
# read input (from gentoo-bug.sh, http://linux.schottelius.org/scripts/#gentoo-bug
reread()
{
_tmp=""
name="$1"
while [ ! "$_tmp" ]; do
read -p "$1 [$_tmp]: " _tmp
done
echo $_tmp
}
for svc in $@; do
echo -n "Creating $svc ..."
mkdir -p "${BASEDIR}/${svc}"
cd ${BASEDIR}/${svc}
mkdir -p "${C_WANTS}" "${C_NEEDS}"
echo "finished."
done