Commit e7fdd755 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Update script

parent 8c3e6eb1
Pipeline #4391 passed with stages
in 40 seconds
......@@ -4,7 +4,8 @@ echo "--- add_manufacturer_to_group_udev.sh ---"
MANUFACTURER="Segway"
GROUP="dialout"
FILE="99-Segway-to-dialout-group.rules"
FILE="99-manufacturer-${MANUFACTURER}-to-group-${GROUP}.rules"
UDEV_PATH="/etc/udev/rules.d"
usage() {
echo "Usage: $0 [-m <manufacturer>] [-g <group>] [-f <file> ]"
......@@ -16,8 +17,12 @@ usage() {
while getopts ":hm:g:f:" arg; do
case $arg in
v) MANUFACTURER=$OPTARG;;
p) GROUP=$OPTARG;;
m) MANUFACTURER=$OPTARG
FILE="99-manufacturer-${MANUFACTURER}-to-group-${GROUP}.rules"
;;
g) GROUP=$OPTARG
FILE="99-manufacturer-${MANUFACTURER}-to-group-${GROUP}.rules"
;;
f) FILE=$OPTARG;;
h) usage;;
*) usage;;
......@@ -25,7 +30,7 @@ while getopts ":hm:g:f:" arg; do
done
shift $((OPTIND-1))
FILE=/etc/udev/rules.d/$FILE
FILE="$UDEV_PATH/$FILE"
echo " Add udev rule so MANUFACTURER=${MANUFACTURER} devices are added to GROUP=${GROUP}."
echo " Adding new lines to udev rule file: ${FILE}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment