forked from openDsh/dash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rpi.sh
78 lines (72 loc) · 1.92 KB
/
rpi.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
#location of OS details for linux
OS_RELEASE_FILE="/etc/os-release"
#check if Raspian OS is active, otherwise kill script
#if grep -q "Raspbian" ${OS_RELEASE_FILE};
#then
# echo "Great this script works for RaspberryPI OS"
#else
# echo "This script works only for an RaspberryPI OS"
# exit 1;
#fi
display_version(){
echo "Version 0.1 RaspberryPI Dash additional install helpers"
}
#########################
# The command line help #
#########################
display_help() {
echo "Usage: $0 [option...]" >&2
echo
echo " -arb, --addrulebrightness Add udev rules for brightness"
echo " -adi, --adddesktopicon Add desktop icon"
echo " -v, --version Show version of script"
echo " -h, --help Show help of script"
echo
echo
echo "Example: Setup udev rule for controlling brightness of an official 7inch Touch screen"
echo " rpi -arb"
echo
echo "Example: Add an desktop icon on your RPI."
echo " rpi -adi"
echo
exit 1
}
################################
# Check if parameters options #
# are given on the commandline #
################################
while :
do
#echo "$1"
case "$1" in
-arb | --addrulebrightness)
/bin/bash src/bash/brightness.sh
exit 0
;;
-adi | --adddesktopicon)
/bin/bash src/bash/desktop.sh
exit 0
;;
-h | --help)
display_help # Call your function
exit 0
;;
-v | --version)
display_version # Call your function
exit 0
;;
--) # End of all options
shift
break
;;
-*)
echo "Error: Unknown option: $1" >&2
## or call function display_help
exit 1
;;
*) # No more options
break
;;
esac
done