/usr/share/doc/elektra-doc/scripts/convert-inittab is in elektra-doc 0.7.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #!/bin/sh
########################################################################
##
## This script will read the /etc/inittab and create an
## equivalent key tree under $ROOT.
##
## The correct way to use it is:
##
## $ ./inittab-convert > init.xml
## # kdb import init.xml
##
## To make tests you can do:
##
## $ ROOT=user/test ./inittab-convert > init.xml
##
## Avi Alkalay <avi@unix.sh>
## March 2004
##
## $Id$
##
########################################################################
[ -z "$RG" ] && RG="kdb"
[ -z "$ROOT" ] && ROOT="system"
echo "<keyset parent=\"$ROOT/init\">"
echo
cat /etc/inittab | sed -e "s/\#.*\$//g; s/\"/\'/g;" | grep -v '^$' |
awk -F : '{
if (seq) seq=seq","$1;
else seq=$1;
printf " <key basename=\"%s/runlevels\" value=\"%s\"><comment>Active runlevels</comment></key>\n", $1,$2;
printf " <key basename=\"%s/action\" value=\"%s\"><comment>Approach</comment></key>\n", $1, $3;
printf " <key basename=\"%s/process\" value=\"%s\"><comment>Program to execute</comment></key>\n", $1, $4;
printf "\n";
} END {
printf " <key basename=\"sequence\" value=\"%s\"><comment>Sequence the entries will run</comment></key>\n", seq;
}'
echo
echo "</keyset>"
|