www.nico.schottelius.org/software/cinit/browse_source/cinit-0.1/bin/cinit.remove.getty
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

23 lines
449 B
Bash

#!/bin/sh
# Nico Schottelius
# cinit: create gettys
# init variables
. $(dirname $0)/cinit.read-conf
BASEDIR=$DESTDIR/$CINIT_DIR/$GETTY_DIR
NUMBER=$(cd $BASEDIR && ls | awk '/^((0[xX])[0-9a-fA-F]+)|([0-9]+)$/ { print }' | tail -n 1)
[ ! "$NUMBER" ] && exit 1
DDIR=$BASEDIR/$NUMBER
echo "Removing getty number $NUMBER located in $DDIR ..."
read -p "Are you sure [y/N]? " yes
if [ "$yes" = "y" ]; then
rm -r $DDIR
else
echo "Aborted."
fi