Dash:
[t2-trunk.git] / package / base / minit / functions
blob6fd22cd9b808b55a5e0c4eef126c570830350a7d
2 minitdir=etc/minit
4 install_minit()
6         if [ -d $base/package/*/minit/inits/$1 ] ; then
7           echo "Installing minit config ..."
8           [ -d $root/$minitdir/$1 ] || mkdir $root/$minitdir/$1
9           for x in $(cd $base/package/*/minit/inits;
10                      find $1 ! -path '*/.*'  -type f); do
11                 src="$base/package/*/minit/inits/$x"
12                 trg="$root/$minitdir/$x"
14                 mkdir -p `dirname $trg`
15                 if [[ $x = */run ]] && grep '^ln -s' $src; then
16                         rm -f $trg ; `cat $src` $trg
17                 else
18                         cp -fv $src $trg
19                         chmod +x $trg
20                 fi
21           done
22         else
23           abort "No minit config known for $1"
24         fi