forked from kermitfrog/inputmangler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·54 lines (44 loc) · 1.61 KB
/
install.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
#!/bin/bash
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../src/
make
if [[ $? -gt 0 ]] ; then
exit 1
fi
echo "inputmangler can run from any directory, so it does not need to be installed system wide - but that doesn't mean you can't"
echo "install to /usr/local/? [y|N]"
read INP
if [[ "$INP" == 'y' || "$INP" == 'y' || "$INP" == 'yes' || "$INP" == 'Yes' ]]; then
sudo make install
fi
cd ../inputdummy
make
echo "inputdummy however is a kernel module and should be installed system wide. Do it? [Y|n]"
read INP
if [[ "$INP" == 'y' || "$INP" == 'y' || "$INP" == 'yes' || "$INP" == 'Yes' || "$INP" == "" ]]; then
sudo make install
fi
cd ..
echo "Append inputdummy to the list of modules that are loaded on boot? [Y|n]"
read INP
if [[ "$INP" == 'y' || "$INP" == 'y' || "$INP" == 'yes' || "$INP" == 'Yes' || "$INP" == "" ]]; then
echo inputdummy | sudo tee -a /etc/modules > /dev/null
fi
echo ""
echo "which user group should have rights to access the input devices? (it will be created if neccessary) [inputmangler]"
read GRP
if [[ "$GRP" == "" ]] ; then
GRP=inputmangler
fi
echo "install udev rules for the kernel module into /etc/udev/rules.d? [Y|n]"
read INP
if [[ "$INP" == 'y' || "$INP" == 'y' || "$INP" == 'yes' || "$INP" == 'Yes' || "$INP" == "" ]]; then
sudo cp inputdummy/40-inputdummy.rules /etc/udev/rules.d/
sed --in-place "s/inputmangler/$GRP/" /etc/udev/rules.d/40-inputdummy.rules
fi
echo "Done!"
echo "if your kernel is updated, you will need to reinstall inputdummy. Do this by going into the inputdummy directory and executing"
echo "make && make install"
echo ""
scripts/make_udev_rules.sh $GRP