source: lliurex-hotpotatoes-data/trunk/fuentes/data/usr/bin/hotpotatoes @ 200

Last change on this file since 200 was 200, checked in by jrpelegrina, 4 years ago

First release to xenial

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/bash
2
3prefs_file=/home/$USER/Library/Preferences/com.halfbakedsoftware/hotpot6prefs.xml
4interface_path=/usr/share/hotpotatoes/interface
5config_path=/usr/share/hotpotatoes/config
6original_prefs=/usr/share/hotpotatoes/hotpot6prefs.xml
7user_conf_path=/home/$USER/config
8user_interface_path=/home/$USER/interface
9
10
11conf_option="none"
12int_option="none"
13
14langs="es_ES.utf8 es_ES.UTF-8"
15
16langs_val="ca_ES.UTF-8@valencia"
17
18
19#### Comprobando idioma del sistema y configurando el script en base a ello...
20
21rm $prefs_file
22
23echo  $langs | grep $LANG && rc=0 || rc=1
24echo  $langs_val | grep $LANG && rc_v=0 || rc_v=1
25
26if [ "$rc" = 0 ]
27then
28        #echo "Configuracion en español"
29        #echo "Instalando..."
30        interface_file=$interface_path/espanol6.xml
31        config_file=$config_path/espanol6.cfg
32        user_conf_file=$user_conf_path/espanol6.cfg
33        user_interface_file=$user_interface_path/espanol6.xml
34        conf_option="espanol6"
35        int_option="espanol6"
36
37elif [ "$rc_v" = 0 ]
38then
39        #echo "Configuracion en valenciano"
40        #echo "Instalando..."
41        interface_file=$interface_path/valencian.xml
42        config_file=$config_path/valencian.cfg
43        user_conf_file=$user_conf_path/valencian.cfg
44        user_interface_file=$user_interface_path/valencian.xml
45        conf_option="valencian"
46        int_option="valencian"
47        export LANG=ca_ES.utf-8
48else
49        #echo "English configuration"
50        #echo "Installing..."
51        interface_file=$interface_path/JHP6English.xml
52        config_file=$config_path/English6.cfg
53        user_conf_file=$user_conf_path/English6.cfg
54        user_interface_file=$user_interface_path/JHP6English.xml
55        conf_option="English6"
56        int_option="JHP6English"
57fi
58
59############################
60
61#### Comprobando existencia de archivos ...
62
63if [ ! -f $prefs_file ]
64then 
65        #echo "Creando archivo de preferencias..."
66        cat $original_prefs | sed -e "s/__@__user__@__/$USER/g" -e "s/__@__interface-language__@__/$int_option/g" -e "s/__@__config-language__@__/$conf_option/g" > /tmp/hotpot6prefs.xml
67        mkdir -p /home/$USER/Library/Preferences/com.halfbakedsoftware/
68        cp /tmp/hotpot6prefs.xml $prefs_file
69        rm /tmp/hotpot6prefs.xml
70fi
71
72if [ ! -f $user_conf_file ]
73then 
74        #echo "Copiando archivo de configuracion de lenguaje... $config_file"
75        mkdir -p $user_conf_path
76        cp $config_file $user_conf_file
77fi
78
79
80if [ ! -f $user_interface_file ]
81then 
82        #echo "Creando archivo de lenguaje de interface... $interface_file"
83        mkdir -p $user_interface_path
84        cp $interface_file $user_interface_file
85fi
86
87
88
89
90
91#################################
92
93#### Ejecutando hotpot6.jar desde subdirectorio...
94cd /usr/share/hotpotatoes/
95java -jar /usr/share/hotpotatoes/JavaHotPotatoes6.app/Contents/Resources/Java/hotpot6.jar
96
97
98
99
Note: See TracBrowser for help on using the repository browser.