summarylogtreecommitdiffstats
path: root/gpm-vm
blob: c8de00420523a07d304491c8093dffb105c905eb (plain)
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
#!/usr/bin/bash

conf="/etc/gpm-vm.conf"

if [[ ! -f "${conf}" ]]; then
   echo "'${conf}' does not exist"
   exit 1
fi

source "${conf}"

if [[ ! -v event ]]; then
   echo "'event' is not set in '${conf}'"
   exit 1
fi

if [[ ! -c "${event}" ]]; then
   echo "'${event}' does not exist or is not a character device"
   exit 1
fi

if [[ ! -v additional_args ]]; then
   additional_args=""
fi

/usr/bin/gpm -m "${event}" -t vbox "${additional_args}"