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

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

Improved lliurex-analytics detection to avoid show user permission confirmation message detected into desktop flavours

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