2
2
# Copyright (C) 2015 Arduino Srl
3
3
#
4
4
# Author : Arturo Rinaldi
5
- # E-mail : arturo@arduino.org
5
+ # E-mail : arty.net2@gmail.com
6
6
# Project URL : https://github.com/artynet/arduino-linux-setup
7
7
#
8
8
# This program is free software: you can redistribute it and/or modify
18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
#
21
+ # Release v10 changelog :
22
+ #
23
+ # + Adding support for Slackware
24
+ # + Changed distribution not supported message
25
+ # + Changed distribution check sort order (thanks to thenktor @github.com)
26
+ # + Small fix for ArchLinux
27
+ #
28
+ # Release v9 changelog :
29
+ #
30
+ # + Adding support for ArchLinux
31
+ # + Adding support for systemd
32
+ # + Fixing a couple of wrong kernel entries
33
+ #
21
34
# Release v8 changelog :
22
35
#
23
36
# + rules are now created in /tmp folder
48
61
# + now the script checks for SUDO permissions
49
62
#
50
63
51
- #! /bin/bash
64
+ #! /bin/bash
52
65
53
66
# if [[ $EUID != 0 ]] ; then
54
67
# echo This must be run as root!
@@ -61,10 +74,16 @@ refreshudev () {
61
74
echo " Restarting udev"
62
75
echo " "
63
76
64
- sudo service udev restart
65
77
sudo udevadm control --reload-rules
66
78
sudo udevadm trigger
67
79
80
+ if [ -d /lib/systemd/ ]
81
+ then
82
+ sudo systemctl restart systemd-udevd
83
+ else
84
+ sudo service udev restart
85
+ fi
86
+
68
87
}
69
88
70
89
groupsfunc () {
@@ -73,10 +92,11 @@ groupsfunc () {
73
92
echo " ******* Add User to dialout,tty, uucp, plugdev groups *******"
74
93
echo " "
75
94
95
+ sudo groupadd plugdev
96
+ sudo groupadd dialout
76
97
sudo usermod -a -G tty $1
77
98
sudo usermod -a -G dialout $1
78
99
sudo usermod -a -G uucp $1
79
- sudo groupadd plugdev
80
100
sudo usermod -a -G plugdev $1
81
101
82
102
}
@@ -88,8 +108,8 @@ acmrules () {
88
108
echo " "
89
109
90
110
cat << EOF
91
- " KERNEL="ttyUSB[0-9]*", TAG+="udev-acl", TAG+="uaccess", OWNER="$1 "
92
- " KERNEL="ttyACM[0-9]*", TAG+="udev-acl", TAG+="uaccess", OWNER="$1 "
111
+ KERNEL= ="ttyUSB[0-9]*", TAG+="udev-acl", TAG+="uaccess", OWNER="$1 "
112
+ KERNEL= ="ttyACM[0-9]*", TAG+="udev-acl", TAG+="uaccess", OWNER="$1 "
93
113
EOF
94
114
95
115
}
@@ -168,21 +188,29 @@ removemm () {
168
188
echo " ******* Removing modem manager *******"
169
189
echo " "
170
190
171
- if [ -f /etc/lsb-release -a ! -f /etc/SuSE-release ] || [ -f /etc/debian_version ] || [ -f /etc/linuxmint/info ]
172
- then
173
- # Only for Ubuntu/Mint/Debian
174
- sudo apt-get -y remove modemmanager
175
- elif [ -f /etc/SuSE-release ]
191
+ if [ -f /etc/SuSE-release ]
176
192
then
177
193
# Only for Suse
178
194
sudo zypper remove modemmanager
179
195
elif [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ]
180
196
then
181
197
# Only for Red Hat/Fedora/CentOS
182
198
sudo yum remove modemmanager
199
+ elif [ -f /etc/arch-release ]
200
+ then
201
+ # Only for ArchLinux
202
+ sudo pacman -Rdd modemmanager
203
+ elif [ -f /etc/slackware-version ]
204
+ then
205
+ # Only for Slackware
206
+ sudo removepkg ModemManager
207
+ elif [ -f /etc/lsb-release ] || [ -f /etc/debian_version ] || [ -f /etc/linuxmint/info ]
208
+ then
209
+ # Only for Ubuntu/Mint/Debian
210
+ sudo apt-get -y remove modemmanager
183
211
else
184
212
echo " "
185
- echo " Your system is not supported, please take care of it with your package manager"
213
+ echo " Your system is not supported, please remove the ModemManager package with your package manager! "
186
214
echo " "
187
215
fi
188
216
0 commit comments