-
Notifications
You must be signed in to change notification settings - Fork 1
/
launch-services.sh
executable file
·56 lines (51 loc) · 1.01 KB
/
launch-services.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
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
#!/bin/bash
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-t|--time)
TIME="$2"
shift # past argument
shift # past value
;;
--kea-log-path)
LOG_PATH="$2"
shift # past argument
shift # past value
;;
--kea-args)
KEA_ARGS="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [ -z $TIME ]; then
TIME="60"
fi
if [ -z $LOG_PATH ]; then
LOG_PATH="/var/log/kea-debug.log"
fi
if [ -z $KEA_ARGS ]; then
KEA_ARGS="-c /kea-config.json"
fi
# Start kea-dhcp4
nohup /usr/sbin/kea-dhcp4 $KEA_ARGS &>/dev/null &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start kea: $status"
exit $status
fi
# Start the second process
ipmi-finder -t $TIME --kea-log-path $LOG_PATH
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start ipmi-finder: $status"
exit $status
fi