-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure
executable file
·43 lines (43 loc) · 937 Bytes
/
configure
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
#!/bin/bash
#
# Hand produced (not Autotools!)
#
outFile="StartSwitchPanel"
prog="/usr/games/SaitekSwitchPanel"
defaultIP="127.0.0.1"
cd Generators
ls *.xml | sed 's/\.xml//'
cd ..
read -p "Select Aircraft configuration from above: " aircraft
echo "export AIRCRAFT=$aircraft" >Configparams
read -p "Do you have 'libudev1' installed (Y/n): " libudev
shopt -s nocasematch
if [[ -z $libudev || $libudev = 'y' ]]
then
echo "export LIBUDEV=1" >>Configparams
Options=""
else
read -p "Switch Panel Device address: " udevdevice
Options="--switch $udevdevice "
fi
read -p "Flightgear computer (default is $defaultIP): " ipaddr
if [ -z $ipaddr ]
then
ipaddr=$defaultIP
fi
Options="$Options --flightgear $ipaddr"
echo "arguments are: $Options"
cat <<EOF >$outFile
#!/bin/bash
#
# Startup file for Switch Panel driver
# generated by ./configure
#
#while :
#do
$prog $Options &
# sleep 1;
#done
EOF
chmod +x $outFile
echo "$outFile created"