#!/bin/sh # # This script will find all PNP configured standard PC serial ports and # then "bounce" them by disabling and then enabling them # # I suggest that you place this script in /sbin and call it # at the top of /etc/setserial or /etc/etc-setserial, depending on your # configuration ENABLE=0 DISABLE=2 ID="id" SERIAL_PORT="PNP0500" STATE="power/state" PNP_DIR="/sys/bus/pnp/devices" for device in ${PNP_DIR}/*; do if grep -q ${SERIAL_PORT} ${device}/${ID}; then echo found serial port at $device, going to bounce it echo -n ${DISABLE} > ${device}/${STATE} echo -n ${ENABLE} > ${device}/${STATE} fi done