#!/bin/bash

# Please initialize to connect star printer in debian-based systems.
# If you want to undo the changes, please unplug and plug in the USB cable.

cp ./50-starusb.rules /etc/udev/rules.d/

# unbind onetime
for device in /sys/bus/usb/drivers/usblp/*:*; do
    if [ -e "$device" ]; then
        echo "unbind ${device}"
        echo "${device##*/}" > /sys/bus/usb/drivers/usblp/unbind
    fi
done

