forked from phath0m/JadedWraith
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·31 lines (25 loc) · 1008 Bytes
/
configure.sh
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
#! /bin/sh
OPTIND=1 # Reset in case getopts has been used previously in the shell.
CONFIGURATION=wraith.conf.make
USE_LIBPCAP=no
INJECTABLE=no
while getopts :-: arg; do
case $arg in
- ) LONG_OPTARG="${OPTARG#*=}"
case $OPTARG in
use-libpcap ) USE_LIBPCAP=yes ;;
injectable ) INJECTABLE=yes ;;
use-libpcap* )
echo "No arg allowed for --$OPTARG option" >&2; exit 2 ;;
'' ) break ;; # "--" terminates argument processing
* ) echo "Illegal option --$OPTARG" >&2; exit 2 ;;
esac ;;
\? ) exit 2 ;; # getopts already reported the illegal option
esac
done
shift $((OPTIND-1)) # remove parsed options and args from $@ list
echo "Enable libpcap = $USE_LIBPCAP"
echo "Injectable = $INJECTABLE"
echo "# This file was automatically generated by configure.sh" > $CONFIGURATION
echo "USE_LIBPCAP=$USE_LIBPCAP" >> $CONFIGURATION
echo "INJECTABLE=$INJECTABLE" >> $CONFIGURATION