Added README for Install
[sgc2.git] / addons / Linux_install.sh
blob19d62c898787884ab0a7d85e380293c08f7aa182
1 #!/bin/bash
2 #
3 # Copy wordlists to SpeakGoodChinese preferences directory
4 ZENITY=`which zenity`
5 if [[ `/bin/uname` != "Darwin" ]] ; then
6 cd "`dirname "$0"`"
7 MACHINE="32"
8 if [[ `/bin/uname -m` =~ "64" ]]; then
9 MACHINE="64"
11 if [[ (-s ~/Desktop/SpeakGoodChinese2 || -s ~/SpeakGoodChinese2) && -n ZENITY ]]; then
12 zenity --info --text="SpeakGoodChinese2 already exists at destination"
13 elif [[ -s ./SGC2/SpeakGoodChinese2_linux${MACHINE}.zip ]]; then
14 if [[ -d ~/Desktop ]]; then
15 unzip ./SGC2/SpeakGoodChinese2_linux${MACHINE}.zip -d ~/Desktop/
16 else
17 unzip ./SGC2/SpeakGoodChinese2_linux${MACHINE}.zip -d ~/
19 if [[ $? != 0 && -n ZENITY ]]; then
20 zenity --info --text='Installation of SpeakGoodChinese2 encountered an error'
21 fi
23 mkdir -p ~/.SpeakGoodChinese2/wordlists
24 cp -r wordlists/* ~/.SpeakGoodChinese2/wordlists/
25 if [[ $? != 0 && -n ZENITY ]]; then
26 zenity --info --text='Installation of the wordlists encountered an error'
27 elif [[ -n ZENITY ]]; then
28 zenity --info --text='Installation completed'
29 fi
30 elif [[ -n ZENITY ]]; then
31 zenity --info --text="THIS INSTALL SCRIPT IS ONLY FOR LINUX, NOT FOR MACINTOSH COMPUTERS (OSX)"
33 exit 0