Group commands and add conditionals

merge-requests/213/head^2
Raf Czlonka 2020-03-25 03:02:56 +00:00
rodzic 0d0c03ab68
commit 6b1b071b77
2 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -9,10 +9,10 @@ case $DEVCLASS in
ugen*)
BUSNAME=$(usbdevs -vv | egrep "Controller|$DEVNAME\$" | grep -B 1 "$DEVNAME\$" | awk -F'[ :]' '/^Controller/ { print $2 }')
echo $BUSNAME > /var/run/${DEVNAME}.bus
chown _cups:_saned /dev/"$DEVNAME".*
chown _cups:_saned /dev/"$BUSNAME"
chmod 660 /dev/"$DEVNAME".*
chown 660 /dev/"$BUSNAME"
chown _cups:_saned /dev/"$DEVNAME".* &&
chmod 660 /dev/"$DEVNAME".*
chown _cups:_saned /dev/"$BUSNAME" &&
chown 660 /dev/"$BUSNAME"
;;
esac
;;

Wyświetl plik

@ -9,11 +9,12 @@ case $DEVCLASS in
ugen*)
BUSNAME=$(cat /var/run/${DEVNAME}.bus)
rm -f /var/run/${DEVNAME}.bus
chown root:wheel /dev/"$DEVNAME".*
chmod 600 /dev/"$DEVNAME".*
test -n "$BUSNAME" &&
chown root:wheel /dev/"$BUSNAME"
chmod 600 /dev/"$BUSNAME"
chown root:wheel /dev/"$DEVNAME".* &&
chmod 600 /dev/"$DEVNAME".*
test -n "$BUSNAME" && {
chown root:wheel /dev/"$BUSNAME" &&
chmod 600 /dev/"$BUSNAME"
}
;;
esac
;;