~pvigo/+junk/linkat-perfil-secundaria-12.04

« back to all changes in this revision

Viewing changes to debian/postinst

  • Committer: Pablo Vigo
  • Date: 2015-05-06 08:04:18 UTC
  • Revision ID: pvigo@xtec.cat-20150506080418-ecwlcd9iw5uf0uoj
Fixed: Llocs favorits nautilus

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/bash
2
2
 
3
 
##### Script per instal·lar el perfil de secundaria a la Linkat edu
 
3
##### Script per instal·lar el perfil secundaria a la Linkat edu
4
4
##
5
5
##
6
6
## By: tsanchez@opentrends.net
 
7
## Modified by: pvigo#xtec.cat
7
8
##
8
 
## Date: 19-07-2013
 
9
## Date: 17-07-2013
9
10
 
10
11
 
11
12
###### Creació de l'usuari secundaria
18
19
        fi
19
20
        useradd secundaria -s /bin/bash -d /home-local/secundaria -c secundaria
20
21
        passwd -d secundaria
21
 
 
22
 
else
23
 
        echo 'Usuari ja existeix, finalitzant' 
24
 
fi
25
 
### Copiem el profile infantil a l'usuari creat
26
 
tar xfz /usr/share/linkat/profiles/secundaria.tar.gz -C /home-local/ 
27
 
chown -R secundaria.secundaria /home-local/secundaria/
28
 
 
29
 
 
 
22
else
 
23
        echo 'Usuari ja existeix' 
 
24
fi
 
25
 
 
26
if [ ! -f /home-local/secundaria/Escriptori/surt.desktop ] ; then
 
27
        ### Copiem el profile secundaria a l'usuari creat
 
28
        tar xfz /usr/share/linkat/profiles/secundaria.tar.gz -C /home-local/
 
29
        chown -R secundaria.secundaria /home-local/secundaria/
 
30
else
 
31
        ### Comprobar que la URL dels mapes sigui correcte
 
32
        slash=/
 
33
        if [ -f /home-local/secundaria/Escriptori/Món\ físic/mapes.desktop ] ; then
 
34
                URL=$(cat /home-local/secundaria/Escriptori/Món\ físic/mapes.desktop | egrep URL)
 
35
                CHR=${URL#${URL%?}}
 
36
                if [ $CHR = $slash ] ; then
 
37
                        echo "La $URL és erronea i es modificarà"
 
38
                        cd $(mktemp -d)
 
39
                        tar zxfv /usr/share/linkat/profiles/secundaria.tar.gz secundaria/Escriptori/Món\ físic/mapes.desktop >/dev/null 2&>1
 
40
                        cp secundaria/Escriptori/Món\ físic/mapes.desktop /home-local/secundaria/Escriptori/Món\ físic/mapes.desktop
 
41
                        rm -rf $(pwd)
 
42
                else
 
43
                        echo "La $URL és correcta"
 
44
                fi
 
45
        fi
 
46
 
 
47
fi