You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DMDirc.sh 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. #!/bin/sh
  2. #
  3. # This script launches dmdirc and attempts to update the jar file if needed.
  4. #
  5. # DMDirc - Open Source IRC Client
  6. # Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
  7. #
  8. # Permission is hereby granted, free of charge, to any person obtaining a copy
  9. # of this software and associated documentation files (the "Software"), to deal
  10. # in the Software without restriction, including without limitation the rights
  11. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. # copies of the Software, and to permit persons to whom the Software is
  13. # furnished to do so, subject to the following conditions:
  14. #
  15. # The above copyright notice and this permission notice shall be included in
  16. # all copies or substantial portions of the Software.
  17. #
  18. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  24. # SOFTWARE.
  25. LAUNCHERVERSION="12"
  26. params=""
  27. # Check the which command exists, and if so make sure it behaves how we want
  28. # it to...
  29. WHICH=`which which 2>/dev/null`
  30. if [ "" = "${WHICH}" ]; then
  31. echo "which command not found. Aborting.";
  32. exit 0;
  33. else
  34. # Solaris sucks
  35. BADWHICH=`which /`
  36. if [ "${BADWHICH}" != "" ]; then
  37. echo "Replacing bad which command.";
  38. # "Which" on solaris gives non-empty results for commands that don't exist
  39. which() {
  40. OUT=`${WHICH} ${1}`
  41. if [ $? -eq 0 ]; then
  42. echo ${OUT}
  43. else
  44. echo ""
  45. fi;
  46. }
  47. fi;
  48. fi
  49. # Store params so that we can pass them back to the client
  50. for param in "$@"; do
  51. if [ "${param}" = "--noprofile" ]; then
  52. continue;
  53. fi;
  54. PSN=`echo "${param}" | grep "^-psn_"`
  55. if [ "" = "${PSN}" ]; then
  56. SPACE=`echo "${param}" | grep " "`
  57. if [ "${SPACE}" != "" ]; then
  58. niceParam=`echo "${param}" | sed 's/"/\\\\"/g'`
  59. params=${params}" \"${niceParam}\""
  60. else
  61. params=${params}" ${param}"
  62. fi;
  63. fi;
  64. done;
  65. # Check for OS X
  66. OSASCRIPT=`which osascript`
  67. KERNEL=`uname -s`
  68. ISOSX="0"
  69. # Kernel is darwin, and osascript exists, probably OS X!
  70. if [ "${KERNEL}" = "Darwin" -a "" != "${OSASCRIPT}" ]; then
  71. ISOSX="1"
  72. fi;
  73. # Check for some CLI params
  74. if [ "${ISOSX}" = "1" ]; then
  75. profiledir="${HOME}/Library/Preferences/DMDirc"
  76. else
  77. profiledir="${HOME}/.DMDirc/"
  78. fi;
  79. USEPROFILE=1;
  80. while test -n "$1"; do
  81. case "$1" in
  82. --directory|-d)
  83. shift
  84. profiledir=${1}
  85. ;;
  86. --noprofile)
  87. USEPROFILE=0;
  88. ;;
  89. esac
  90. shift
  91. done
  92. if [ "${ISOSX}" != "1" ]; then
  93. PIDOF=`which pidof`
  94. if [ "${PIDOF}" = "" ]; then
  95. # For some reason some distros hide pidof...
  96. if [ -e /sbin/pidof ]; then
  97. PIDOF=/sbin/pidof
  98. elif [ -e /usr/sbin/pidof ]; then
  99. PIDOF=/usr/sbin/pidof
  100. fi;
  101. fi;
  102. ## Helper Functions
  103. if [ "${PIDOF}" != "" ]; then
  104. ISKDE=`${PIDOF} -x -s kdeinit`
  105. ISGNOME=`${PIDOF} -x -s gnome-panel`
  106. else
  107. ISKDE=`ps -Af | grep kdeinit | grep -v grep`
  108. ISGNOME=`ps -Af | grep gnome-panel | grep -v grep`
  109. fi;
  110. KDIALOG=`which kdialog`
  111. ZENITY=`which zenity`
  112. KSUDO=`which kdesudo`
  113. GSUDO=`which gksudo`
  114. fi;
  115. errordialog() {
  116. # Send message to console.
  117. echo ""
  118. echo "-----------------------------------------------------------------------"
  119. echo "Error: ${1}"
  120. echo "-----------------------------------------------------------------------"
  121. echo "${2}"
  122. echo "-----------------------------------------------------------------------"
  123. if [ "${ISOSX}" = "1" -a "" != "${OSASCRIPT}" ]; then
  124. echo "Displaying dialog.."
  125. ${OSASCRIPT} -e 'tell application "System Events"' -e "activate" -e "display dialog \"${1}\n${2}\" buttons {\"Ok\"} with icon stop" -e 'end tell'
  126. else
  127. if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
  128. echo "Dialog on Display: ${DISPLAY}"
  129. ${KDIALOG} --title "DMDirc: ${1}" --error "${1}\n\n${2}"
  130. elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
  131. echo "Dialog on Display: ${DISPLAY}"
  132. ${ZENITY} --error --title "DMDirc: ${1}" --text "${1}\n\n${2}"
  133. fi
  134. fi;
  135. }
  136. messagedialog() {
  137. # Send message to console.
  138. echo ""
  139. echo "-----------------------------------------------------------------------"
  140. echo "Info: ${1}"
  141. echo "-----------------------------------------------------------------------"
  142. echo "${2}"
  143. echo "-----------------------------------------------------------------------"
  144. if [ "${ISOSX}" = "1" -a "" != "${OSASCRIPT}" ]; then
  145. echo "Displaying dialog.."
  146. ${OSASCRIPT} -e 'tell application "System Events"' -e "activate" -e "display dialog \"${1}\n${2}\" buttons {\"Ok\"} giving up after 120 with icon note" -e 'end tell'
  147. else
  148. if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
  149. echo "Dialog on Display: ${DISPLAY}"
  150. ${KDIALOG} --title "DMDirc: ${1}" --msgbox "${1}\n\n${2}"
  151. elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
  152. echo "Dialog on Display: ${DISPLAY}"
  153. ${ZENITY} --info --title "DMDirc: ${1}" --text "${1}\n\n${2}"
  154. fi
  155. fi;
  156. }
  157. getConfigOption() {
  158. FILE="${profiledir}/dmdirc.config"
  159. WANTED_DOMAIN="${1}"
  160. WANTED_KEY="${2}"
  161. CURRENT_SECTION=""
  162. if [ "${WANTED_KEY}" != "" -a "${WANTED_DOMAIN}" = "" ]; then
  163. if [ -e "${FILE}" ]; then
  164. cat ${FILE} | sed 's/\\/\\\\/g' | while IFS='' read -r LINE; do
  165. IS_SECTION=`echo ${LINE} | egrep "^.*:$"`
  166. IS_KEYVALUE=`echo ${LINE} | egrep "^[[:space:]]+.*=.*$"`
  167. if [ "" != "${IS_SECTION}" ]; then
  168. CURRENT_SECTION=${LINE%%:*}
  169. elif [ "" != "${IS_KEYVALUE}" ]; then
  170. KEY=`echo ${LINE%%=*} | sed 's/^\s*//g'`
  171. VALUE=${LINE##*=}
  172. if [ "${WANTED_DOMAIN}" = "${CURRENT_SECTION}" -a "${WANTED_KEY}" = "${KEY}" ]; then
  173. echo ${VALUE};
  174. fi;
  175. fi;
  176. done;
  177. fi;
  178. fi;
  179. }
  180. # LOOKANDFEEL=`getConfigOption "ui" "lookandfeel" | tail -n 1`
  181. if [ "${ISOSX}" = "1" ]; then
  182. jarDir=`dirname $0`/../Resources/Java/
  183. jar=${jarDir}DMDirc.jar
  184. else
  185. jar=`dirname $0`/DMDirc.jar
  186. fi
  187. launcherUpdater=${profiledir}/updateLauncher.sh
  188. BSDJava1="/usr/local/jdk1.6.0/jre/bin/java"
  189. BSDJava2="/usr/local/diablo-jdk1.6.0/jre/bin/java"
  190. echo "---------------------"
  191. echo "DMDirc - Open Source IRC Client"
  192. echo "Launcher Version: ${LAUNCHERVERSION}"
  193. echo "Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes"
  194. echo "---------------------"
  195. if [ "${ISOSX}" = "1" ]; then
  196. echo "Running on OS X."
  197. elif [ "${KERNEL}" = "Linux" ]; then
  198. echo "Running on Linux."
  199. elif [ "`echo ${KERNEL} | grep -i BSD`" != "" ]; then
  200. echo "Running on BSD."
  201. elif [ "`echo ${KERNEL} | grep -i SunOS`" != "" ]; then
  202. echo "Running on Solaris."
  203. else
  204. echo "Running on unknown unix variation: ${KERNEL}."
  205. fi;
  206. echo -n "Checking for launcher updates in ${profiledir} - ";
  207. if [ -e "${profiledir}/.launcher.sh.ignore" ]; then
  208. rm -Rf "${profiledir}/.launcher.sh.ignore"
  209. echo "Ignoring!";
  210. elif [ -e "${profiledir}/.launcher.sh" ]; then
  211. echo "Found!";
  212. echo "Attempting to update..";
  213. cat <<EOF> ${launcherUpdater}
  214. cd `dirname $0`
  215. errordialog() {
  216. # Send message to console.
  217. echo ""
  218. echo "-----------------------------------------------------------------------"
  219. echo "Error: \${1}"
  220. echo "-----------------------------------------------------------------------"
  221. echo "\${2}"
  222. echo "-----------------------------------------------------------------------"
  223. if [ "${ISOSX}" = "1" -a "" != "${OSASCRIPT}" ]; then
  224. echo "Displaying dialog.."
  225. ${OSASCRIPT} -e 'tell application "System Events"' -e "activate" -e "display dialog \"${1}\n${2}\" buttons {\"Ok\"} with icon stop" -e 'end tell'
  226. else
  227. if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
  228. echo "Dialog on Display: ${DISPLAY}"
  229. ${KDIALOG} --title "DMDirc: \${1}" --error "\${1}\n\n\${2}"
  230. elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
  231. echo "Dialog on Display: ${DISPLAY}"
  232. ${ZENITY} --error --title "DMDirc: \${1}" --text "\${1}\n\n\${2}"
  233. fi
  234. fi
  235. }
  236. messagedialog() {
  237. # Send message to console.
  238. echo ""
  239. echo "-----------------------------------------------------------------------"
  240. echo "Info: \${1}"
  241. echo "-----------------------------------------------------------------------"
  242. echo "\${2}"
  243. echo "-----------------------------------------------------------------------"
  244. if [ "${ISOSX}" = "1" -a "" != "${OSASCRIPT}" ]; then
  245. echo "Displaying dialog.."
  246. ${OSASCRIPT} -e 'tell application "System Events"' -e "activate" -e "display dialog \"${1}\n${2}\" buttons {\"Ok\"} giving up after 120 with icon note" -e 'end tell'
  247. else
  248. if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
  249. echo "Dialog on Display: ${DISPLAY}"
  250. ${KDIALOG} --title "DMDirc: \${1}" --msgbox "\${1}\n\n\${2}"
  251. elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
  252. echo "Dialog on Display: ${DISPLAY}"
  253. ${ZENITY} --info --title "DMDirc: \${1}" --text "\${1}\n\n\${2}"
  254. fi
  255. fi;
  256. }
  257. mv -fv ${profiledir}/.launcher.sh ${0}
  258. if [ ! -e "${profiledir}/.launcher.sh" ]; then
  259. echo "Launcher Update successful."
  260. messagedialog "Launcher Update" "Launcher Update successful"
  261. else
  262. if [ "${UID}" = "" ]; then
  263. UID=`id -u`;
  264. fi
  265. if [ "0" != "${UID}" ]; then
  266. if [ "${ISOSX}" = "1" ]; then
  267. messagedialog "DMDirc" "The DMDirc Client Updater was unable to modify the client installation, trying again with administrator access"
  268. if [ $? -eq 0 ]; then
  269. echo "Password dialog on display"
  270. osascript -e do shell script "mv -fv \"${profiledir}/.launcher.sh\" \"${0}\"" with administrator privileges
  271. fi;
  272. else
  273. if [ "" != "${ISKDE}" -a "" != "${KSUDO}" -a "" != "${DISPLAY}" ]; then
  274. echo "Password dialog on ${DISPLAY}"
  275. ${KSUDO} --comment "DMDirc Client Updater requires root access to modify the global installation" -- mv -fv "${profiledir}/.launcher.sh" "${0}"
  276. elif [ "" != "${ISGNOME}" -a "" != "${GSUDO}" -a "" != "${DISPLAY}" ]; then
  277. echo "Password dialog on ${DISPLAY}"
  278. ${GSUDO} -k --message "DMDirc Client Updater requires root access to modify the global installation" -- mv -fv "${profiledir}/.launcher.sh" "${0}"
  279. else
  280. echo "DMDirc Client Updater requires root access to modify the global installation"
  281. sudo mv -fv "${profiledir}/.launcher.sh" "${0}"
  282. fi;
  283. fi;
  284. fi
  285. if [ ! -e "${profiledir}/.launcher.sh" ]; then
  286. echo "Update successful."
  287. messagedialog "Launcher Update" "Launcher Update successful"
  288. else
  289. echo "Launcher failed."
  290. errordialog "Launcher Update" "Launcher Update failed, using old version"
  291. touch ${profiledir}/.launcher.sh.ignore
  292. fi;
  293. fi;
  294. sh ${0} ${params}
  295. EOF
  296. chmod a+x ${launcherUpdater}
  297. ${launcherUpdater}
  298. exit 0;
  299. else
  300. echo "Not found.";
  301. fi;
  302. if [ -e "${launcherUpdater}" ]; then
  303. rm -Rf "${launcherUpdater}"
  304. fi;
  305. echo -n "Checking for client updates in ${profiledir} - ";
  306. if [ -e "${profiledir}/.DMDirc.jar" ]; then
  307. echo "Found!";
  308. echo "Attempting to update..";
  309. mv -fv ${profiledir}/.DMDirc.jar ${jar}
  310. if [ ! -e "${profiledir}/.DMDirc.jar" ]; then
  311. echo "Update successful."
  312. messagedialog "Client Update" "Client Update successful"
  313. else
  314. if [ "${UID}" = "" ]; then
  315. UID=`id -u`;
  316. fi
  317. if [ "0" != "${UID}" ]; then
  318. if [ "${ISOSX}" = "1" ]; then
  319. messagedialog "DMDirc" "The DMDirc Client Updater was unable to modify the client installation, trying again with administrator access"
  320. if [ $? -eq 0 ]; then
  321. echo "Password dialog on display"
  322. osascript -e "do shell script \"mv -fv \\\"${profiledir}/.DMDirc.jar\\\" \\\"${jar}\\\"\" with administrator privileges"
  323. fi;
  324. else
  325. if [ "" != "${ISKDE}" -a "" != "${KSUDO}" -a "" != "${DISPLAY}" ]; then
  326. echo "Password dialog on ${DISPLAY}"
  327. ${KSUDO} --comment "DMDirc Client Updater requires root access to modify the global installation" -- mv -fv "${profiledir}/.DMDirc.jar" "${jar}"
  328. elif [ "" != "${ISGNOME}" -a "" != "${GSUDO}" -a "" != "${DISPLAY}" ]; then
  329. echo "Password dialog on ${DISPLAY}"
  330. ${GSUDO} -k --message "DMDirc Client Updater requires root access to modify the global installation" -- mv -fv "${profiledir}/.DMDirc.jar" "${jar}"
  331. else
  332. echo "DMDirc Client Updater requires root access to modify the global installation"
  333. sudo mv -fv "${profiledir}/.DMDirc.jar" "${jar}"
  334. fi;
  335. fi;
  336. fi
  337. if [ ! -e "${profiledir}/.DMDirc.jar" ]; then
  338. echo "Update successful."
  339. messagedialog "Client Update" "Client Update successful"
  340. else
  341. echo "Update failed."
  342. errordialog "Client Update" "Client Update failed, using old version"
  343. fi;
  344. fi
  345. else
  346. echo "Not found.";
  347. fi;
  348. relaunch() {
  349. trap - INT TERM EXIT
  350. echo ""
  351. echo "============================================================="
  352. echo "ERROR"
  353. echo "============================================================="
  354. echo "${HOME}/.profile has errors in it (or an 'exit' command)."
  355. echo "Setup will now restart with the --noprofile option."
  356. echo "============================================================="
  357. sh ${0} ${params} --noprofile
  358. }
  359. echo -n "Looking for java - ";
  360. if [ "${ISOSX}" = "1" ]; then
  361. JAVA=`which java`
  362. if [ -e "/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java" ]; then
  363. JAVA="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java"
  364. elif [ -e "/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java" ]; then
  365. JAVA="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java"
  366. fi;
  367. else
  368. if [ -e "${HOME}/.profile" -a "${USEPROFILE}" = "1" ]; then
  369. # Source the profile incase java can't be found otherwise
  370. trap relaunch INT TERM EXIT
  371. . ${HOME}/.profile
  372. trap - INT TERM EXIT
  373. fi;
  374. JAVA=`which java`
  375. if [ ! -e "${JAVA}" ]; then
  376. # Location where ports on FreeBSD/PCBSD installs java6
  377. # check it first, because it isn't added to the path automatically
  378. JAVA=${BSDJava1}
  379. if [ ! -e "${JAVA}" ]; then
  380. # Try alternative BSD Location
  381. JAVA=${BSDJava2}
  382. fi;
  383. fi;
  384. fi;
  385. if [ "" != "${JAVA}" ]; then
  386. echo "Success! (${JAVA})"
  387. else
  388. echo "Failed!"
  389. ERROR="Sorry, java does not appear to be installed on this machine.";
  390. ERROR=${ERROR}"\n"
  391. if [ "${ISOSX}" = "1" ]; then
  392. ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM.";
  393. else
  394. ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM, you can get one from: http://www.java.com";
  395. ERROR=${ERROR}"\nor reinstall DMDirc and let the installer install one for you.";
  396. fi;
  397. errordialog "Unable to launch dmdirc!" "${ERROR}";
  398. exit 1;
  399. fi
  400. echo -n "Running DMDirc - "
  401. if [ -e "${jar}" ]; then
  402. # Check that DMDirc will run, if java is not 1.6 this will fail.
  403. # We do it this way otherwise segfaults etc would cause an unable to launch
  404. # error message to be printed.
  405. ${JAVA} -jar ${jar} --help >/dev/null 2>&1
  406. if [ $? -ne 0 ]; then
  407. FAILED=1
  408. # If we are on BSD, check to see if there is alternative versions of java
  409. # than the one in the path.
  410. if [ "`echo ${KERNEL} | grep -i BSD`" != "" ]; then
  411. if [ "${JAVA}" != "${BSDJava1}" -a "${JAVA}" != "${BSDJava2}" ]; then
  412. JAVA=${BSDJava1}
  413. if [ ! -e "${JAVA}" ]; then
  414. JAVA=${BSDJava2}
  415. fi;
  416. # Now check to see if DMDirc runs again.
  417. ${JAVA} -jar ${jar} --help >/dev/null 2>&1
  418. if [ $? -eq 0 ]; then
  419. # It runs!
  420. FAILED=0
  421. fi;
  422. fi;
  423. fi;
  424. if [ ${FAILED} -eq 1 ]; then
  425. echo "Failed."
  426. ERROR="Sorry, the currently installed version of java is not compatible with DMDirc.";
  427. ERROR=${ERROR}"\n";
  428. if [ "${ISOSX}" = "1" ]; then
  429. ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM.";
  430. else
  431. ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM, you can get one from: http://www.java.com";
  432. ERROR=${ERROR}"\nor reinstall DMDirc and let the installer install one for you.";
  433. fi;
  434. errordialog "Unable to launch dmdirc!" "${ERROR}";
  435. exit 1;
  436. fi;
  437. fi
  438. # Now we can run the client for real, this allows stderr/stdout output
  439. # to be seen, and the shell script exits with the correct exit code.
  440. APPLEOPTS=""
  441. if [ "${ISOSX}" = "1" ]; then
  442. APPLEOPTS="${APPLEOPTS} -Djava.library.path=${jarDir}"
  443. #APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.growbox.intrudes=false"
  444. #APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.live-resize=true"
  445. APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.apple.menu.about.name=DMDirc"
  446. #APPLEOPTS="${APPLEOPTS} -Dapple.awt.showGrowBox=true"
  447. #APPLEOPTS="${APPLEOPTS} -Dapple.laf.useScreenMenuBar=true"
  448. fi;
  449. ${JAVA}${APPLEOPTS} -ea -jar ${jar} -l unix-${LAUNCHERVERSION} ${params}
  450. EXITCODE=${?}
  451. if [ ${EXITCODE} -eq 42 ]; then
  452. # The client says we need to up update, rerun ourself before exiting.
  453. ${0} ${params}
  454. fi;
  455. exit ${EXITCODE};
  456. else
  457. echo "Failed.";
  458. errordialog "Unable to launch dmdirc!" "No jar file found";
  459. fi