1 | #!/bin/bash |
---|
2 | |
---|
3 | |
---|
4 | ######VARIABLES########### |
---|
5 | #RUTA DE LOS PERFILES DE CONKY |
---|
6 | FILE_PATH=/usr/share/lliurex-conky |
---|
7 | CONKYRC_ADMIN=$FILE_PATH/conkyrc_admins |
---|
8 | CONKYRC_ADMIN_BASE=$FILE_PATH/conkyrc_admins_base |
---|
9 | CONKYRC_STUDENTS=$FILE_PATH/conkyrc_students |
---|
10 | CONKYRC_STUDENTS_BASE=$FILE_PATH/conkyrc_students_base |
---|
11 | CONKYRC_USED=$FILE_PATH/conkyrc_used |
---|
12 | |
---|
13 | |
---|
14 | READED=TRUE |
---|
15 | |
---|
16 | SELECTION2=STUDENT |
---|
17 | |
---|
18 | #########Variables para las traducciones############ |
---|
19 | export TEXTDOMAIN="lliurex-conky" |
---|
20 | MSG_INICIAL=$(gettext "Do you want conky on desktop?") |
---|
21 | MSG_CONFIGURATOR=$(gettext "CONKY CONFIGUTATOR. SELECT THE FORMAT THAT YOU LIKE") |
---|
22 | MSG_SELECCIONA=$(gettext "SELECT") |
---|
23 | MSG_ESTILO=$(gettext "STYLE") |
---|
24 | MSG_DESCRIPCION=$(gettext "DESCRIPTION") |
---|
25 | MSG_SERVER=$(gettext "SERVER") |
---|
26 | MSG_SERVER_DESC=$(gettext "Show and monitor, CPU, RAM, NET AND HARD DISK") |
---|
27 | MSG_CLIENT=$(gettext "CLIENT") |
---|
28 | MSG_CLIENT_DESC=$(gettext "Show only basic mode, HOSTNAME, ARCHITECTURE, VERSION AND NET ADDRESS") |
---|
29 | MSG_TITPARAM=$(gettext "CONKY CONFIGURATOR, SELECT THE PARAMETERS WHAT YOU WANT TO SEE IN YOUR DESKTOP:") |
---|
30 | MSG_PARAMETRO=$(gettext "PARAMETER") |
---|
31 | MSG_USER=$(gettext "USER") |
---|
32 | MSG_USER_DESC=$(gettext "User logged to the session in Pc") |
---|
33 | MSG_HOSTNAME=$(gettext "HOSTNAME") |
---|
34 | MSG_HOSTNAME_DESC=$(gettext "Netname to the Pc") |
---|
35 | MSG_CLIENT_TYPE=$(gettext "LliureX type client") |
---|
36 | MSG_ARCHITECTURE=$(gettext "ARCHITECTURE") |
---|
37 | MSG_ARCHITECTURE_DESC=$(gettext "Architecture type, 32 or 64 Bits") |
---|
38 | MSG_VERSION=$(gettext "VERSION") |
---|
39 | MSG_VERSION_DESC=$(gettext "LliureX version installed") |
---|
40 | MSG_NET_ADDRESS=$(gettext "NET ADDRESS") |
---|
41 | MSG_NET_ADDRESS_DESC=$(gettext "Show Ip address for every netcards connected") |
---|
42 | MSG_MIRROR=$(gettext "MIRROR") |
---|
43 | MSG_MIRROR_DESC=$(gettext "LliureX version mirror downloaded") |
---|
44 | MSG_HDD_ALERT=$(gettext "HDD ALERT") |
---|
45 | MSG_HDD_ALERT_DESC=$(gettext "Alert to the user, if the hard disk has occuped 91% or more") |
---|
46 | MSG_KERNEL_VERSION=$(gettext "KERNEL VERSION") |
---|
47 | MSG_KERNEL_VERSION_DESC=$(gettext "kernel version used at the moment") |
---|
48 | MSG_UPTIME=$(gettext "UPTIME") |
---|
49 | MSG_UPTIME_PANEL=$(gettext "Uptime") |
---|
50 | MSG_UPTIME_DESC=$(gettext "how much time has the machine uptime") |
---|
51 | MSG_CPU_TYPE=$(gettext "CPU TYPE") |
---|
52 | MSG_CPU_TYPE_DES=$(gettext "Cpu type installed at the Pc") |
---|
53 | MSG_CPU_BAR=$(gettext "CPU BAR") |
---|
54 | MSG_CPU_BAR_DESC=$(gettext "Process bar for indicate CPU used in %") |
---|
55 | MSG_CPU_GRAPH=$(gettext "CPU GRAPH") |
---|
56 | MSG_CPU_GRAPH_DESC=$(gettext "Cpu graphic to monitorize it at time") |
---|
57 | MSG_RAM_USAGE=$(gettext "RAM USAGE") |
---|
58 | MSG_RAM_USAGE_PANEL=$(gettext "RAM Usage") |
---|
59 | MSG_RAM_USAGE_DESC=$(gettext "Show how many Ram is installed and how many Ram is used at the moment") |
---|
60 | MSG_RAM_BAR=$(gettext "RAM BAR") |
---|
61 | MSG_RAM_BAR_DESC=$(gettext "Ram bar to indicate how many it's used at the moment") |
---|
62 | MSG_SWAP_USAGE=$(gettext "SWAP USAGE") |
---|
63 | MSG_SWAP_USAGE_PANEL=$(gettext "SWAP Usage") |
---|
64 | MSG_SWAP_USAGE_DESC=$(gettext "Show how many Swap is installed and how many Swap is used at the moment") |
---|
65 | MSG_SWAP_BAR=$(gettext "SWAP BAR") |
---|
66 | MSG_SWAP_BAR_DESC=$(gettext "Swap bar to indicate how many it's used at the moment") |
---|
67 | MSG_NET_ADDRESS=$(gettext "NET ADDRESS") |
---|
68 | MSG_NET_ADDRESS_DESC=$(gettext "Show Ip address for every netcards connected") |
---|
69 | MSG_NET_DOWNLOAD=$(gettext "NET DOWNLOAD") |
---|
70 | MSG_NET_DOWNLOAD_DESC=$(gettext "Show net speed downloading files") |
---|
71 | MSG_NET_UPLOAD=$(gettext "NET UPLOAD") |
---|
72 | MSG_NET_UPLOAD_DESC=$(gettext "Show net speed uploading files") |
---|
73 | MSG_HDD_USED=$(gettext "HDD USED") |
---|
74 | MSG_HDD_USED_DESC=$(gettext "Bar to indicates HDD used") |
---|
75 | MSG_DATOS_PANEL=$(gettext "DATA") |
---|
76 | MSG_SYSTEM_PANEL=$(gettext "SYSTEM") |
---|
77 | MSG_HDD_PANEL=$(gettext "HDD") |
---|
78 | MSG_SERVER_PANEL=$(gettext "Server") |
---|
79 | MSG_LIGERO_PANEL=$(gettext "Thin") |
---|
80 | MSG_PESADO_PANEL=$(gettext "Heavy") |
---|
81 | MSG_SEMILIGERO_PANEL=$(gettext "Semithin") |
---|
82 | MSG_DESKTOP_PANEL=$(gettext "Desktop") |
---|
83 | |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | ##Funcion para el server y su mirror |
---|
89 | function conky_mirror () { |
---|
90 | |
---|
91 | VERSION_32='0' |
---|
92 | VERSION_64='0' |
---|
93 | FICHERO='/tmp/mirror_version.txt' |
---|
94 | |
---|
95 | rm $FICHERO |
---|
96 | touch $FICHERO |
---|
97 | |
---|
98 | VERSION=$(find /net/mirror/llx1505/pool/main/l/lliurex-meta -name 'lliurex-cdd_*386.deb' | head -1 ) |
---|
99 | |
---|
100 | if [ -n "$VERSION" ]; then |
---|
101 | |
---|
102 | NUMERO_32=$(echo ${VERSION%%_i386.deb}| cut -d_ -f2 ) |
---|
103 | echo 'VERSION 32 BITS:' $NUMERO_32 >> $FICHERO |
---|
104 | |
---|
105 | fi |
---|
106 | |
---|
107 | VERSION=$(find /net/mirror/llx1505/pool/main/l/lliurex-meta -name 'lliurex-cdd_*amd64.deb' | head -1 ) |
---|
108 | |
---|
109 | if [ -n "$VERSION" ]; then |
---|
110 | |
---|
111 | NUMERO_64=$(echo ${VERSION%%_amd64.deb}| cut -d_ -f2 ) |
---|
112 | echo 'VERSION 64 BITS:' $NUMERO_64 >> $FICHERO |
---|
113 | |
---|
114 | fi |
---|
115 | |
---|
116 | } |
---|
117 | |
---|
118 | |
---|
119 | ##Compruebo la version de conky a usar |
---|
120 | |
---|
121 | lliurex-version > /tmp/conky-test.txt |
---|
122 | echo $LTSP_FATCLIENT > /tmp/conky-test-fat.txt |
---|
123 | |
---|
124 | SERVIDOR=$(grep "server" /tmp/conky-test.txt -c) |
---|
125 | #echo "Variable Servidor es $SERVIDOR" |
---|
126 | if [ "$SERVIDOR" != "0" ]; then |
---|
127 | Z=$(echo $DISPLAY | cut -d ":" -f 1) |
---|
128 | #echo "La variable Z es: $Z" |
---|
129 | if [ -z $Z ]; then |
---|
130 | echo "Soy un Servidor" |
---|
131 | #conky -c $CONKYRC_USED |
---|
132 | SOY="SERVER" |
---|
133 | conky_mirror |
---|
134 | else |
---|
135 | echo "Soy un Ligero" |
---|
136 | #conky -c $CONKYRC_STUDENTS |
---|
137 | SOY="STUDENT" |
---|
138 | fi |
---|
139 | else |
---|
140 | CLIENTE=$(grep "client" /tmp/conky-test.txt -c) |
---|
141 | if [ "$CLIENTE" != "0" ]; then |
---|
142 | SEMI=$(grep "true" /tmp/conky-test-fat.txt -c) |
---|
143 | if [ "$SEMI" != "0" ]; then |
---|
144 | echo "Soy Semiligero" |
---|
145 | #conky -c $CONKYRC_STUDENTS |
---|
146 | SOY="STUDENT" |
---|
147 | else |
---|
148 | echo "Soy un Pesado" |
---|
149 | #conky -c $CONKYRC_STUDENTS |
---|
150 | SOY="STUDENT" |
---|
151 | fi |
---|
152 | else |
---|
153 | echo "Soy un Desktop" |
---|
154 | #conky -c $CONKYRC_USED |
---|
155 | SOY="STUDENT" |
---|
156 | fi |
---|
157 | fi |
---|
158 | |
---|
159 | echo "Utilizare el script de $SOY" |
---|
160 | |
---|
161 | ####FUNCIONES##### |
---|
162 | |
---|
163 | function cancelar () { |
---|
164 | |
---|
165 | if [[ $1 -eq 1 ]] ; then |
---|
166 | #Contesto que no quiere que sea visible |
---|
167 | echo "No será visible, se ha cancelado el proceso" |
---|
168 | :> $CONKYRC_USED |
---|
169 | echo '#modified_by_user' >> $CONKYRC_USED |
---|
170 | zero-center set-non-configured lliurex-conky |
---|
171 | zero-center remove-pulsating-color lliurex-conky |
---|
172 | exit 0 |
---|
173 | fi |
---|
174 | |
---|
175 | } |
---|
176 | |
---|
177 | |
---|
178 | ##QUEREMOS CONKY VISIBLE O NO## |
---|
179 | function avaiable (){ |
---|
180 | zenity --question --text "$MSG_INICIAL" |
---|
181 | cancelar $? |
---|
182 | } |
---|
183 | |
---|
184 | ##INFORMAMOS DE LO QUE SOMOS Y RECOMENDAMOS UN CONKY |
---|
185 | |
---|
186 | function recomends () { |
---|
187 | if [[ $1 != "STUDENT" ]]; then |
---|
188 | PRESELECT_SERVER="TRUE" |
---|
189 | PRESELECT_STUDENT="FALSE" |
---|
190 | else |
---|
191 | PRESELECT_SERVER="FALSE" |
---|
192 | PRESELECT_STUDENT="TRUE" |
---|
193 | fi |
---|
194 | |
---|
195 | SELECTION2=`zenity --list --width 900 --height=250 --text "$MSG_CONFIGURATOR" --radiolist --column "$MSG_SELECCIONA" --hide-column=2 --column "PARAMETRO" --column "$MSG_ESTILO" --column "$MSG_DESCRIPCION" \ |
---|
196 | $PRESELECT_SERVER "SERVER" "$MSG_SERVER" "$MSG_SERVER_DESC" \ |
---|
197 | $PRESELECT_STUDENT "CLIENTE" "$MSG_CLIENT" "$MSG_CLIENT_DESC" \ |
---|
198 | --separator=":"` |
---|
199 | cancelar $? |
---|
200 | echo $SELECTION2 |
---|
201 | |
---|
202 | } |
---|
203 | |
---|
204 | |
---|
205 | ##LECTURA DE DATOS CONKY STUDENT## |
---|
206 | function student_rc () { |
---|
207 | SELECTION=`zenity --list --width 550 --height=420 --text "$MSG_TITPARAM" --checklist --column "$MSG_SELECCIONA" --hide-column=2 --column "SELECCIONA" --column "$MSG_PARAMETRO" --column "$MSG_DESCRIPCION" \ |
---|
208 | TRUE "USUARIO" "$MSG_USER" "$MSG_USER_DESC" \ |
---|
209 | TRUE "EQUIPO" "$MSG_HOSTNAME" "$MSG_HOSTNAME_DESC" \ |
---|
210 | TRUE "CLIENTE" "$MSG_CLIENT" "$MSG_CLIENT_TYPE" \ |
---|
211 | TRUE "ARQUITECTURA" "$MSG_ARCHITECTURE" "$MSG_ARCHITECTURE_DESC" \ |
---|
212 | TRUE "VERSION" "$MSG_VERSION" "$MSG_VERSION_DESC" \ |
---|
213 | TRUE "IP_ADDRESS" "$MSG_NET_ADDRESS" "$MSG_NET_ADDRESS_DESC" \ |
---|
214 | --separator=":"` |
---|
215 | cancelar $? |
---|
216 | #echo "$SELECTION" |
---|
217 | } |
---|
218 | |
---|
219 | ##LECTURA DE DATOS CONKY SERVER## |
---|
220 | function server_rc () { |
---|
221 | |
---|
222 | SELECTION=`zenity --list --width 850 --height=620 --text "$MSG_TITPARAM" --checklist --column "$MSG_SELECCIONA" --hide-column=2 --column "SELECCIONA" --column "$MSG_PARAMETRO" --column "$MSG_DESCRIPCION" \ |
---|
223 | $READED "USUARIO" "$MSG_USER" "$MSG_USER_DESC" \ |
---|
224 | TRUE "EQUIPO" "$MSG_HOSTNAME" "$MSG_HOSTNAME_DESC" \ |
---|
225 | TRUE "CLIENTE" "$MSG_CLIENT" "$MSG_CLIENT_TYPE" \ |
---|
226 | TRUE "ARQUITECTURA" "$MSG_ARCHITECTURE" "$MSG_ARCHITECTURE_DESC" \ |
---|
227 | TRUE "VERSION" "$MSG_VERSION" "$MSG_VERSION_DESC" \ |
---|
228 | TRUE "MIRROR_VERSION" "$MSG_MIRROR" "$MSG_MIRROR_DESC" \ |
---|
229 | TRUE "HDD_ALERT" "$MSG_HDD_ALERT" "$MSG_HDD_ALERT_DESC" \ |
---|
230 | TRUE "KERNEL" "$MSG_KERNEL_VERSION" "$MSG_KERNEL_VERSION_DESC" \ |
---|
231 | TRUE "UPTIME" "$MSG_UPTIME" "$MSG_UPTIME_DESC" \ |
---|
232 | TRUE "CPU_TYPE" "$MSG_CPU_TYPE" "$MSG_CPU_TYPE" \ |
---|
233 | TRUE "CPU_BAR" "$MSG_CPU_BAR" "$MSG_CPU_BAR_DESC" \ |
---|
234 | TRUE "CPU_GRAPH" "$MSG_CPU_GRAPH" "$MSG_CPU_GRAPH_DESC" \ |
---|
235 | TRUE "RAM_USAGE" "$MSG_RAM_USAGE" "$MSG_RAM_USAGE_DESC" \ |
---|
236 | TRUE "RAM_BAR" "$MSG_RAM_BAR" "$MSG_RAM_BAR_DESC" \ |
---|
237 | TRUE "SWAP_USAGE" "$MSG_SWAP_USAGE" "$MSG_SWAP_USAGE_DESC" \ |
---|
238 | TRUE "SWAP_BAR" "$MSG_SWAP_BAR" "$MSG_SWAP_BAR_DESC" \ |
---|
239 | TRUE "IP_ADDRESS" "$MSG_NET_ADDRESS" "$MSG_NET_ADDRESS_DESC" \ |
---|
240 | TRUE "NET_DOWNLOAD" "$MSG_NET_DOWNLOAD" "$MSG_NET_DOWNLOAD_DESC" \ |
---|
241 | TRUE "NET_UPLOAD" "$MSG_NET_UPLOAD" "$MSG_NET_UPLOAD_DESC" \ |
---|
242 | TRUE "HDD_USED" "$MSG_HDD_USED" "$MSG_HDD_USED_DESC" \ |
---|
243 | --separator=":"` |
---|
244 | cancelar $? |
---|
245 | |
---|
246 | } |
---|
247 | |
---|
248 | ##########PROGRAMA PRINCIPAL############ |
---|
249 | killall conky |
---|
250 | avaiable |
---|
251 | recomends $SOY |
---|
252 | SOY="$SELECTION2" |
---|
253 | |
---|
254 | if [[ $SOY != "CLIENTE" ]]; then |
---|
255 | server_rc |
---|
256 | rm $CONKYRC_USED |
---|
257 | cp $CONKYRC_ADMIN_BASE $CONKYRC_USED |
---|
258 | #echo "">>$CONKYRC_USED |
---|
259 | ####DATOS INICIALES#### |
---|
260 | if [[ $SELECTION == *USUARIO* ]] || [[ $SELECTION == *EQUIPO* ]] || [[ $SELECTION == *CLIENTE* ]] || [[ $SELECTION == *ARQUITECTURA* ]] || [[ $SELECTION == *VERSION* ]] ; then echo '${template0 '$MSG_DATOS_PANEL'}' >> $CONKYRC_USED;fi |
---|
261 | if [[ $SELECTION == *USUARIO* ]] ; then echo ''$MSG_USER': $LOGNAME' >> $CONKYRC_USED;fi |
---|
262 | if [[ $SELECTION == *EQUIPO* ]] ; then echo ''$MSG_HOSTNAME': $nodename' >> $CONKYRC_USED;fi |
---|
263 | if [[ $SELECTION == *CLIENTE* ]] ; then echo ''$MSG_CLIENT': ${if_match ${exec grep "server" /tmp/conky-test.txt -c}!=0}${if_empty ${exec echo $DISPLAY | cut -d ":" -f 1}}'$MSG_SERVER_PANEL'${else}'$MSG_LIGERO_PANEL'${endif}${else}${if_match ${exec grep "client" /tmp/conky-test.txt -c}!=0}${if_empty ${exec cat /tmp/conky-test-fat.txt | grep true }}'$MSG_PESADO_PANEL'${else}'$MSG_SEMILIGERO_PANEL'${endif}${else}'$MSG_DESKTOP_PANEL'${endif}${endif}' >> $CONKYRC_USED;fi |
---|
264 | if [[ $SELECTION == *ARQUITECTURA* ]] ; then echo ''$MSG_ARCHITECTURE': ${if_match ${exec grep "x86_64" /tmp/architecture.txt -c}!=0}64 Bits${else}32 Bits${endif}' >> $CONKYRC_USED;fi |
---|
265 | if [[ $SELECTION == *VERSION* ]] ; then echo ''$MSG_VERSION': ${exec cat /usr/share/lliurex-cdd/version}' >> $CONKYRC_USED;fi |
---|
266 | if [[ $SELECTION == *MIRROR_VERSION* ]] ; then echo '${if_match ${exec grep "VERSION 32" /tmp/mirror_version.txt -c}!=0}${if_match ${exec grep "VERSION 64" /tmp/mirror_version.txt -c}!=0}${template6}${else}${template5 32}${endif}${else}${if_match ${exec grep "VERSION 64" /tmp/mirror_version.txt -c}!=0}${template5 64}${endif}${endif}' >> $CONKYRC_USED;fi |
---|
267 | if [[ $SELECTION == *HDD_ALERT* ]] ; then echo '${if_match ${fs_used_perc /}>=91}${execi 1000 /usr/share/lliurex-conky/hdd_full}${else}${endif}' >> $CONKYRC_USED;fi |
---|
268 | ####SYSTEMA#### |
---|
269 | if [[ $SELECTION == *HDD_ALERT* ]] ; then echo "No blank added";else echo "">> $CONKYRC_USED;fi |
---|
270 | if [[ $SELECTION == *KERNEL* ]] || [[ $SELECTION == *UPTIME* ]] ; then echo '${template0 '$MSG_SYSTEM_PANEL'}' >> $CONKYRC_USED;fi |
---|
271 | if [[ $SELECTION == *KERNEL* ]] ; then echo 'Kernel $alignr $kernel' >> $CONKYRC_USED;fi |
---|
272 | if [[ $SELECTION == *UPTIME* ]] ; then echo ''$MSG_UPTIME_PANEL' $alignr $uptime' >> $CONKYRC_USED;fi |
---|
273 | ####CPU#### |
---|
274 | if [[ $SELECTION == *CPU* ]] ; then echo "">> $CONKYRC_USED; echo '${template0 CPU}' >> $CONKYRC_USED;fi |
---|
275 | if [[ $SELECTION == *CPU_TYPE* ]] ; then echo "\${exec cat /proc/cpuinfo | grep 'model name' | cut -c 14-42 | uniq }" >> $CONKYRC_USED;fi |
---|
276 | if [[ $SELECTION == *CPU_BAR* ]] ; then echo '$cpu % ${cpubar}' >> $CONKYRC_USED;fi |
---|
277 | if [[ $SELECTION == *CPU_GRAPH* ]] ; then |
---|
278 | echo '${cpugraph}' >> $CONKYRC_USED; |
---|
279 | else |
---|
280 | echo "">> $CONKYRC_USED |
---|
281 | fi |
---|
282 | ####RAM#### |
---|
283 | if [[ $SELECTION == *RAM* ]] || [[ $SELECTION == *SWAP* ]] ; then echo '${template0 RAM}' >> $CONKYRC_USED;fi |
---|
284 | if [[ $SELECTION == *RAM_USAGE* ]] ; then echo ''$MSG_RAM_USAGE_PANEL': $mem/$memmax' >> $CONKYRC_USED;fi |
---|
285 | if [[ $SELECTION == *RAM_BAR* ]] ; then echo '$memperc% $membar' >> $CONKYRC_USED;fi |
---|
286 | if [[ $SELECTION == *SWAP_USAGE* ]] ; then echo ''$MSG_SWAP_USAGE_PANEL':$swap/$swapmax' >> $CONKYRC_USED;fi |
---|
287 | if [[ $SELECTION == *SWAP_BAR* ]] ; then echo '$swapperc% ${swapbar}' >> $CONKYRC_USED;fi |
---|
288 | ####NETWORK#### |
---|
289 | if [[ $SELECTION == *IP_ADDRESS* ]] && [[ $SELECTION == *NET_DOWNLOAD* ]] && [[ $SELECTION == *NET_UPLOAD* ]] ; then echo '${template3 eth0 ETH0}${template3 wlan0 WLAN0}' >> $CONKYRC_USED; echo '${template3 eth1 ETH1}${template3 wlan1 WLAN1}' >> $CONKYRC_USED; echo '${template3 eth2 ETH2}${template3 wlan2 WLAN2}' >> $CONKYRC_USED; |
---|
290 | elif [[ $SELECTION == *NET_DOWNLOAD* ]] ; then echo '${template5 eth0 ETH0}${template5 wlan0 WLAN0}' >> $CONKYRC_USED; echo '${template5 eth1 ETH1}${template5 wlan1 WLAN1}' >> $CONKYRC_USED; echo '${template5 eth2 ETH2}${template5 wlan2 WLAN2}' >> $CONKYRC_USED; |
---|
291 | elif [[ $SELECTION == *NET_UPLOAD* ]] ; then echo '${template6 eth0 ETH0}${template6 wlan0 WLAN0}' >> $CONKYRC_USED; echo '${template6 eth1 ETH1}${template6 wlan1 WLAN1}' >> $CONKYRC_USED; echo '${template6 eth2 ETH2}${template6 wlan2 WLAN2}' >> $CONKYRC_USED; |
---|
292 | elif [[ $SELECTION == *IP_ADDRESS* ]] ; then echo '${template7 eth0 ETH0}${template7 wlan0 WLAN0}' >> $CONKYRC_USED; echo '${template7 eth1 ETH1}${template7 wlan1 WLAN1}' >> $CONKYRC_USED; echo '${template7 eth2 ETH2}${template7 wlan2 WLAN2}' >> $CONKYRC_USED; |
---|
293 | fi |
---|
294 | ####HDD#### |
---|
295 | if [[ $SELECTION == *HDD* ]] ; then echo '${template0 '$MSG_HDD_PANEL'}' >> $CONKYRC_USED;fi |
---|
296 | if [[ $SELECTION == *CPU_TYPE* ]] ; then echo '${template1 /}' >> $CONKYRC_USED; echo '${if_mounted /net${template1 /net}}$endif' >> $CONKYRC_USED;fi |
---|
297 | |
---|
298 | #####LINEA QUE ME SIRVE PARA INDICAR QUE FUE MODIFICADO POR EL USUARIO, SE AÑADE AL INICIO DEL FICHERO |
---|
299 | sed -i '1s/^/#modified_by_user\n/' $CONKYRC_USED |
---|
300 | |
---|
301 | conky -c $CONKYRC_USED |
---|
302 | |
---|
303 | else |
---|
304 | student_rc |
---|
305 | rm $CONKYRC_USED |
---|
306 | cp $CONKYRC_STUDENTS_BASE $CONKYRC_USED |
---|
307 | ####DATOS INICIALES#### |
---|
308 | if [[ $SELECTION == *USUARIO* ]] ; then echo ''$MSG_USER': $LOGNAME' >> $CONKYRC_USED;fi |
---|
309 | if [[ $SELECTION == *EQUIPO* ]] ; then echo ''$MSG_HOSTNAME': $nodename' >> $CONKYRC_USED;fi |
---|
310 | if [[ $SELECTION == *CLIENTE* ]] ; then echo ''$MSG_CLIENT': ${if_match ${exec grep "server" /tmp/conky-test.txt -c}!=0}${if_empty ${exec echo $DISPLAY | cut -d ":" -f 1}}'$MSG_SERVER_PANEL'${else}'$MSG_LIGERO_PANEL'${endif}${else}${if_match ${exec grep "client" /tmp/conky-test.txt -c}!=0}${if_empty ${exec cat /tmp/conky-test-fat.txt | grep true }}'$MSG_PESADO_PANEL'${else}'$MSG_SEMILIGERO_PANEL'${endif}${else}'$MSG_DESKTOP_PANEL'${endif}${endif}' >> $CONKYRC_USED;fi |
---|
311 | if [[ $SELECTION == *ARQUITECTURA* ]] ; then echo ''$MSG_ARCHITECTURE': ${if_match ${exec grep "x86_64" /tmp/architecture.txt -c}!=0}64 Bits${else}32 Bits${endif}' >> $CONKYRC_USED;fi |
---|
312 | if [[ $SELECTION == *VERSION* ]] ; then echo ''$MSG_VERSION': ${exec cat /usr/share/lliurex-cdd/version}' >> $CONKYRC_USED;fi |
---|
313 | if [[ $SELECTION == *IP_ADDRESS* ]] ; then echo '$hr${template1 eth0 ETH0}${template1 eth1 ETH1}${template1 eth2 ETH2}${template1 eth3 ETH3}${template1 eth4 ETH4}'>> $CONKYRC_USED;fi |
---|
314 | echo '$hr' >> $CONKYRC_USED |
---|
315 | |
---|
316 | #####LINEA QUE ME SIRVE PARA INDICAR QUE FUE MODIFICADO POR EL USUARIO,SE AÑADE AL INICIO DEL FICHERO |
---|
317 | sed -i '1s/^/#modified_by_user\n/' $CONKYRC_USED |
---|
318 | |
---|
319 | conky -c $CONKYRC_USED |
---|
320 | fi |
---|
321 | |
---|
322 | echo "Conky modificado........STARTING IT" |
---|
323 | zero-center set-configured lliurex-conky |
---|
324 | zero-center remove-pulsating-color lliurex-conky |
---|
325 | exit 0 |
---|
326 | |
---|