summaryrefslogtreecommitdiffstats
path: root/urunlevel/my_linux/Trinux/pkgadd
diff options
context:
space:
mode:
Diffstat (limited to 'urunlevel/my_linux/Trinux/pkgadd')
-rwxr-xr-xurunlevel/my_linux/Trinux/pkgadd62
1 files changed, 62 insertions, 0 deletions
diff --git a/urunlevel/my_linux/Trinux/pkgadd b/urunlevel/my_linux/Trinux/pkgadd
new file mode 100755
index 0000000..f04834b
--- /dev/null
+++ b/urunlevel/my_linux/Trinux/pkgadd
@@ -0,0 +1,62 @@
1#!/bin/sh
2#
3# pkgadd - adds trinux packages (c) 1999 OpenSEC under GPL
4#
5# Author: Matthew Franz <mfranz@cisco.com>
6#
7# $1 = name of package
8#
9##########################################################################
10
11if [ $# -ne 0 ]
12then
13 rm /*.tgz 2> /dev/null; rm /*.md5 2> /dev/null
14
15 # accepting package name with/without tarball extension
16
17 if echo $1 | grep -v tgz > /dev/null
18 then
19 FILE="$1.tgz"
20 else
21 FILE=$1
22 fi
23
24 PREFIX=`echo $FILE | cut -d"." -f1`
25
26 if [ -f $FILE ]
27 then
28 echo "Adding $FILE"
29 PF=`pwd`
30 #cp $FILE /; cd /
31 cd /
32 gunzip -c $PF/${FILE} | tar xf -
33
34 if [ -f /etc/init.d/${PREFIX} ]
35 then
36 chmod a+x /etc/init.d/${PREFIX} 2> /dev/null
37 echo; echo "Initializing package: $PREFIX"
38 /etc/init.d/${PREFIX} 2> /dev/null
39 elif [ -f /etc/init.m/${PREFIX} ]
40 then
41 chmod a+x /etc/init.m/${PREFIX} 2> /dev/null
42 echo; echo "Initializing module: $PREFIX"
43 /etc/init.m/${PREFIX} 2> /dev/null
44 fi
45
46# base=`echo $FILE | cut -d"." -f1`
47# tar xf $base.tar
48
49 #rm $FILE
50
51 [ -x /etc/pkg/$PREFIX ] && ./etc/pkg/$PREFIX
52 else
53 echo "$FILE not found"
54 fi
55
56else # no parameters !!
57 echo "Usage: "
58 echo ' pkgadd filename[.tgz] '
59 echo
60fi
61
62