File: initialize

package info (click to toggle)
dbacl 1.12-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,000 kB
  • ctags: 2,373
  • sloc: ansic: 16,594; sh: 7,963; makefile: 244; yacc: 167; lex: 78; awk: 24; xml: 17; perl: 8
file content (37 lines) | stat: -rwxr-xr-x 899 bytes parent folder | download | duplicates (5)
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
#!/bin/bash
#
# This script searches the current directory for a self extracting
# dbacl/TREC archive and runs it. It is only a stub for the self extracting archive.
# This script accepts several command line arguments to change its behaviour.
# If no options are given, sensible defaults are used.
#
# initialize [OPTIONS.xxx] [VERSION.yyy]
#
# VERSION.yyy         this option forces the extraction of dbacl-xxx.TREC.sfx.sh
# OPTIONS.xxx         this option passes the xxx option to the self extracting script

OPT=""
SFX=`ls dbacl-*.TREC.sfx.sh | sort | head -1`

for i in $@ ; do
    case $i in
	OPTIONS.*)
	    OPT=`echo $i | sed s/^OPTIONS.//`
	    echo "Passing option $OPT"
	;;

	VERSION.*)
	    V=`echo $i | sed s/^VERSION.//`
	    SFX="dbacl-$V.TREC.sfx.sh"
	;;
    esac
done

if [ -f $SFX ]; then
    sh "$SFX" "$OPT"
else
    echo "The file $SFX does not exist :-("
    exit 1
fi

exit 0