source: lliurex-zero-installers/trunk/fuentes/lliurex-zero-installer-analytics.install/usr/bin/confirmator @ 1178

Last change on this file since 1178 was 1178, checked in by mabarracus, 5 years ago

Fix confirmation message from analytics

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/bash
2
3DETECT=$(n4d-client -c ZCenterVariables -m get_state -a lliurex-zero-installer-analytics)
4if [ $DETECT -ne 1 ]; then 
5    exit 0
6fi
7# Script messages l10n
8
9# Detects which language is set
10_langrc=0
11echo $LANGUAGE | grep -q "^ca_ES" || _langrc=1
12
13# All message strings in both languages
14VA_CONFIRM="Desitgeu acceptar la monitorització d'estadístiques?"
15ES_CONFIRM="¿Desea aceptar la monitoritzación de estadísticas?"
16
17# Valencian is selected by default
18CONFIRM="$VA_CONFIRM"
19
20# But they could change if Spanish is detected
21if [ $_langrc -eq 1 ] ; then
22        CONFIRM="$ES_CONFIRM"
23fi
24
25
26
27if [ ! -f "${HOME}/.config/stats_accepted" -a ! -f "${HOME}/.config/stats_declined" ];then
28    zenity --question --text "$CONFIRM"
29    if [ $? -eq 0 ]; then
30        touch ${HOME}/.config/stats_accepted
31    else
32        touch ${HOME}/.config/stats_declined
33    fi
34fi
35
36if [ -f ${HOME}/.config/stats_accepted ]; then
37    mkdir /var/tmp/stats
38    chmod 777 /var/tmp/stats
39    touch /var/tmp/stats/do_stats
40    chmod 666 /var/tmp/stats/do_stats
41fi
42if [ -f ${HOME}/.config/stats_declined ]; then
43    rm /var/tmp/do_stats
44fi
Note: See TracBrowser for help on using the repository browser.