working on Epson printer installer
authorChris Sharp <csharp@georgialibraries.org>
Wed, 5 Feb 2014 11:31:03 +0000 (06:31 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 5 Feb 2014 11:31:03 +0000 (06:31 -0500)
pines-ubuntu.sh

index 02b758a..a4fe8f8 100755 (executable)
@@ -28,8 +28,11 @@ UBUNTU_VERSION=`lsb_release -r | cut -d':' -f2 | sed 's/\t//g'`
 DESKTOP="$HOME/Desktop"
 DE="$DESKTOP_SESSION"
 EPSON_URL="http://download.epson-biz.com/modules/pos/index.php?page=single_soft&cid=3839&scat=32&pcat=3&pid=36"
+DOWNLOAD_DIR="$HOME/Downloads"
+EPSON_TAR="tmx-cups-2.0.0.0.tar.gz"
+EPSON_DIR="tmx-cups"
 
-
+DownloadExtract() {
 if [ ! -d "$CLIENT_DIR" ]; then
     wget $CLIENT_URL_BASE/$CLIENT
     mkdir -p "$CLIENT_DIR"
@@ -41,6 +44,7 @@ if [ ! -d "$CLIENT_DIR" ]; then
 else
     echo "Client Directory Exists, skipping Download"
 fi
+}
 
 ConfigureLubuntu() {
 echo "Configuring for Lubuntu..."
@@ -61,11 +65,39 @@ EOF
 }
 
 DownloadEpson() {
+clear
+echo
 echo "This will now open a browser window where you can download"
-echo "the Epson TM-V receipt printer driver"
+echo "the Epson TM-V receipt printer driver.  Please choose to save"
+echo "the file, then close the browser to continue."
 sensible-browser $EPSON_URL
+if [ -e $DOWNLOAD_DIR/$EPSON_TAR ]; then
+    cd $HOME
+    tar xzf $DOWNLOAD_DIR/$EPSON_TAR
+    cd $EPSON_DIR || {
+    echo "Could not change to $EPSON_DIR."
+    exit 1;
+    }
+    echo
+    echo
+    echo "Starting Epson installer."
+    if [ "$ARCH" = "i386" ]; then
+        echo "Choose Ubuntu 12.04 (32-bit) when prompted by the installer script."
+    elif [ "$ARCH" = "x86_64" ]; then
+        echo "Choose Ubuntu 12.04 (64-bit) when prompted by the installer script."
+    else
+        echo "System architecture not detected.  Please choose Ubuntu 12.04 for"
+        echo "your system's architecture when prompted by the installer script"
+    fi
+    ./install.sh && echo "Epson installation complete."
+else
+    echo "Epson driver package not downloaded to expected location."
+    echo "Please download and install the Epson driver manually."
+    exit 0;
+fi
 }
 
+DownloadExtract
 if [ "$DE" = "Lubuntu" ]; then
     ConfigureLubuntu
 fi