File: firebird-utils.wrapper

package info (click to toggle)
firebird2.5 2.5.2.26540.ds4-1~deb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 43,624 kB
  • sloc: ansic: 373,110; cpp: 291,289; sql: 17,678; fortran: 6,818; sh: 5,772; yacc: 5,709; pascal: 1,153; makefile: 725; perl: 88; sed: 84; csh: 15
file content (50 lines) | stat: -rw-r--r-- 1,129 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
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

set -eu

SUPPORTED_VERSIONS="2.5 2.1 2.0 1.5"
SUPPORTED_UTILS="fbstat gbak gdef gfix gpre isql-fb qli gsec nbackup"
BASE="/usr/lib/firebird"

PROG=`basename $0`

FOUND=""
for i in $SUPPORTED_UTILS;
do
    if [ "$i" = "$PROG" ];
    then
        FOUND="$i"
        break
    fi
done

if [ -z "$FOUND" ];
then
    echo "$PROG utility is not known."
    exit 1
fi

if [ -n "${FB_VER:-}" ]; then
    export FIREBIRD="$BASE/$FB_VER"

    if [ -x "/usr/bin/$PROG-$FB_VER" ];
    then
        exec "/usr/bin/$PROG-$FB_VER" "$@"
    else
        echo /usr/bin/$PROG-$FB_VER is not executable. Try installing firebird$FB_VER-super or firebird$FB_VER-classic packages, or specify different version in 'FB_VER' environment variable.
        exit 1
    fi
fi

for v in $SUPPORTED_VERSIONS; do
    if [ -x "/usr/bin/$PROG-$v" ]; then
        export FIREBIRD="$BASE/$v"
        exec "/usr/bin/$PROG-$v" "$@"
    fi
done

echo "No supported version of '$PROG' utility was found."
echo "Please install some of the firebirdVER-FLAVOUR packages"
echo "VER beng one of $SUPPORTED_VERSIONS"
echo "and FLAVOUR being 'super' or 'classic'"