#!/bin/bash## ink2text-start.sh scriptInstallDir=/usr/local/share/ship/client
JarFile=SHIP_Ink2Text_v1.1.0.jar
ClientPIDFile="$HOME"/.ship-pid
Ink2TextLockFile="$HOME"/.ink2text-lock
## Check for ink2text lock fileif[ -f "$Ink2TextLockFile"];then# echo "Ink2text already running. Aborting."
zenity --info --text "Ink2text already running. Aborting.However if you think it is not, wait for 10-15s, run the\"ink2text-end.sh\" script and then run this script once more."&exit0else## Create ink2text lock file
touch "$Ink2TextLockFile"fiwhile(true)doif[ -f "$ClientPIDFile"];then## If ship-pid file is found, then check whether ship is running## or notClientPID=$(cat "$ClientPIDFile")ClientRun=$(ps -A | grep "$ClientPID")RecogServer=$(pgrep RecognitionServ)if[ -z "$ClientRun"];then## If SHIP client is NOT running then kill the server
pkill RecognitionServ
rm -f "$ClientPIDFile"
rm -f "$Ink2TextLockFile"exit0fielse## If ship-pid file is not found, then start server and clientecho"Starting recognition server"## Start RecognitionServerexportWINEPREFIX="$HOME"/.wine-Ink2Text
wine /usr/local/bin/RecognitionServer.exe 8888&
sleep 1s
## Start ship-clientcd"$InstallDir"echo"Starting SHIP client"
alltray java -Djava.library.path=/usr/lib/jni -Dswing.aatext=true\
-jar "$JarFile" ship.properties &
sleep 1s
ShipClientPID=$(pgrep -n java)echo"$ShipClientPID" > "$ClientPIDFile"fi
sleep 3s
done
Any idea what's up? It also looks like the single ampersands don't register either. I've made each of them "&&" instead and I don't get errors anymore.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Copy and save the two codes below by the name "ink2text-start.sh" and "ink2text-end.sh" respectively.
Ink2text-end script
After saving the above codes make them executable and copy them in your PATH
To start the Ink2text server and run the SHIP client, run the command
To close the server and client, run the command
The start.sh script isn't working for me. Terminal spits back an error:
ink2text-start.sh: 20: ink2text-start.sh: Syntax error: "then" unexpected (expecting "done")
Any idea what's up? It also looks like the single ampersands don't register either. I've made each of them "&&" instead and I don't get errors anymore.