aboutsummaryrefslogtreecommitdiffstats
path: root/sdk/bin/instsvc
blob: 468fe2a8a1608ab82791b32947e125159be0f670 (plain)
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
#!/bin/sh

etc='/etc'

if [ ! -d "$etc" ] ; then
	etc=''
	if [ -d /config ] ; then
		etc='/config'
	fi
fi

if [ -z "$etc" ] ; then
	exit 0
fi

svc=$etc/$1
shift
base=$1
shift
line=$base" $*"

grep "^$base" <$svc >/dev/null
if [ $? = 1 ] ; then
	echo "Adding $base to $svc"
	echo $line >>$svc
fi