-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.in
executable file
·87 lines (66 loc) · 1.89 KB
/
run.in
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#! /bin/bash
#----------------------------------------------------------------------------
# Get our program name
#----------------------------------------------------------------------------
PROG=`basename $0`
#----------------------------------------------------------------------------
# Environment setup.
#----------------------------------------------------------------------------
# Where is OpenSSL 1.1.x?
OPENSSL_LIBDIR=@OPENSSL_LIBDIR@
if [ "$OPENSSL_LIBDIR" != "" ]
then
if [ "$LD_LIBRARY_PATH" = "" ]
then
export LD_LIBRARY_PATH=$OPENSSL_LIBDIR
else
export LD_LIBRARY_PATH=$OPENSSL_LIBDIR:$LD_LIBRARY_PATH
fi
fi
# Do we need to add curl's libdir?
CURL_LIBDIR=@CURL_LIBDIR@
if [ "$CURL_LIBDIR" != "" ]
then
if [ "$LD_LIBRARY_PATH" = "" ]
then
export LD_LIBRARY_PATH=$OPENSSL_LIBDIR
else
export LD_LIBRARY_PATH=$OPENSSL_LIBDIR:$LD_LIBRARY_PATH
fi
fi
#----------------------------------------------------------------------------
# Parse our settings file
#----------------------------------------------------------------------------
. ./settings
# Optional settings
if [ "$LINKABLE" != "" -a "0$LINKABLE" -ne 0 ]; then
flag_linkable=-l
fi
# Optional client settings
if [ "$RANDOM_NONCE" != "" -a "0$RANDOM_NONCE" -ne 0 ]; then
cl_nonce=-r
fi
if [ "$USE_PLATFORM_SERVICES" != "" -a "0$USE_PLATFORM_SERVICES" -ne 0 ]; then
cl_pse=-m
fi
# Debugging options
if [ "$VERBOSE" != "" -a "0$VERBOSE" -ne 0 ]; then
flag_verbose=-v
fi
if [ "$DEBUG" != "" -a "0$DEBUG" -ne 0 ]; then
flag_debug=-d
fi
#----------------------------------------------------------------------------
# Execute
#----------------------------------------------------------------------------
if [ "$PROG" = "run-client" ]
then
./client \
-s $SPID \
$cl_nonce $cl_pse \
$flag_linkable $flag_debug $flag_verbose \
"$@"
else
echo "$PROG: unrecognized instance (expected run-client or run-server)" >&2
exit 1
fi