#!/bin/bash # enable universe repository sudo sed -i "s/# \(deb .* universe\)/\1/" /etc/apt/sources.list # install libs sudo apt-get install -y libkrb53 sudo apt-get install -y libxcb-render-util0 sudo apt-get install -y libxml2 sudo apt-get install -y libcupsimage2 # get b500 driver if [ ! -f /tmp/pips-b500dn-Ubuntu8.04-3.2.0-CG.tgz ]; then wget http://lx3.avasys.jp/B300_B308_B500DN_B508DN/pips-b500dn-Ubuntu8.04-3.2.0-CG.tgz -O /tmp/pips-b500dn-Ubuntu8.04-3.2.0-CG.tgz fi tar xzf /tmp/pips-b500dn-Ubuntu8.04-3.2.0-CG.tgz -C /tmp cd /tmp bash /tmp/pips-b500dn-Ubuntu8.04-3.2.0-CG.install --noexec --keep # wait util all files are extacted while [ $(find /tmp/release/ -name "*.deb" | wc -l) -lt 3 ]; do sleep 1 done # fix pips-common package on Ubuntu Oneiric RELEASE=$(lsb_release -rs | tr -d ".") if [ ${RELEASE} -ge 1110 ]; then DEBDIR=/tmp/release/deb [ -d ${DEBDIR}/ ] && rm -r ${DEBDIR}/ mkdir ${DEBDIR}/ dpkg-deb -x /tmp/release/pips-common_3.2.0-3_i386.deb ${DEBDIR}/ dpkg-deb --control /tmp/release/pips-common_3.2.0-3_i386.deb ${DEBDIR}/DEBIAN sed -i 's|libxcb-render-util0, ||g' ${DEBDIR}/DEBIAN/control sed -i 's|libxml2 (>= 2.6.27), ||g' ${DEBDIR}/DEBIAN/control sed -i 's|libkrb53 (>= 1.6.dfsg.2), ||g' ${DEBDIR}/DEBIAN/control dpkg -b ${DEBDIR}/ /tmp/release/pips-common_3.2.0-3_i386.deb fi # install b500 driver sudo dpkg -i --force-architecture /tmp/release/pips-common_3.2.0-3_i386.deb sudo dpkg -i --force-architecture /tmp/release/pips-ubuntu8.04_3.2.0-3_i386.deb sudo dpkg -i --force-architecture /tmp/release/pips-b500dn_3.2.0-3_i386.deb # create network printer if IP specified if [ -n "${1}" ]; then sudo lpadmin -p Epson_B-500DN -v socket://${1}:2501 -E -P /usr/share/cups/model/ekb500dn.ppd fi