diff --git a/scripts/debian/postinst b/scripts/debian/postinst index edcb12d60c849793bc7081383bb851867d53a89f..7a56aa5c9210d6ec32cbf298f3691f6d2aa4781d 100755 --- a/scripts/debian/postinst +++ b/scripts/debian/postinst @@ -6,11 +6,14 @@ case "$1" in configure) #echo " Calling script" #/var/lib/dpkg/info/iri-comm-dev.hello_world - echo " Addind user to dialout group..." - sudo usermod -a -G dialout $SUDO_USER - echo " Done." - echo " Adding 99-iri-comm-ftdi udev rule..." + if [ ! -z "$SUDO_USER" ]; then + echo " Addind user to dialout group..." + sudo usermod -a -G dialout $SUDO_USER + echo " Done." + fi + + echo " Adding 99-iri-comm-ftdi udev rule..." FILE="/lib/udev/rules.d/99-iri-comm-ftdi.rules" LINE0="#The following line allow the users on dialout to access SUBSYSTEM:VENDOR:PRODUCT=usb|usb_device:0403:6001 devices" LINE1="SUBSYSTEM==\"usb|usb_device\", ATTRS{idVendor}==\"0403\", ATTRS{idProduct}==\"6001\", GROUP=\"dialout\""