source: lliurex-jclic-user-library/trunk/fuentes/lliurex-jclic-user-library.install/usr/bin/lliurex-jclic-user-library @ 3497

Last change on this file since 3497 was 3497, checked in by mabarracus, 3 years ago

Fix bugs

File size: 3.2 KB
Line 
1#!/bin/bash
2
3libs=$(for x in $(find /net/server-sync/share/jclic-aula/ -maxdepth 2 -name library.jclic -o -name jclic.jclic);do if [ "$(cat $x|grep menuElement|wc -l)" -gt "9" ]; then echo $x; fi; done;)
4
5L_RATOLI=''
6L_MESTRE=''
7L_MURCIA=''
8
9for x in $libs; do 
10    if [ -n "$(echo $x|egrep -i -o 'ratoli'|uniq)" ];then
11        L_RATOLI='<library name="Activitats JClic Infantil i Primària 29/07/2012" path="/net/server-sync/share/jclic-aula/ratoli/library.jclic" />'
12    fi
13    if [ -n "$(echo $x|egrep -i -o 'elteumestre'|uniq)" ];then
14        L_MESTRE='<library name="elteumestre JClic Infantil i Primària" path="/net/server-sync/share/jclic-aula/elteumestre_JClic_Infantil_Primaria_13.7/jclic.jclic" />'
15    fi
16    if [ -n "$(echo $x|egrep -i -o 'murcia'|uniq)" ];then
17        L_MURCIA='<library name="Biblioteca CPR MURCIA II 08/09" path="/net/server-sync/share/jclic-aula/Murcia/library.jclic" />'
18
19    fi
20done;
21
22# Creacion plantillas de ficheros
23IFS=''
24edu_xtec_properties='#Tue Nov 08 13:04:30 CET 2016
25JClic=/home/__alumno__/JClic
26language=es'
27
28
29jclic_cfg='<?xml version="1.0" encoding="UTF-8"?>
30<JClicSettings>
31 <libraryManager autoRun="true">
32 __lib1__
33 __lib2__
34 __lib3__
35 </libraryManager>
36 <language id="es" />
37 <paths>
38  <path id="root" path="/home/__alumno__/JClic/projects" />
39 </paths>
40 <reporter enabled="false" class="TCPReporter" params="path=server:9000" />
41 <sound enabled="true" system="true" mediaSystem="default" />
42 <lookAndFeel id="default" />
43 <browser id="" />
44 <skin id="@default.xml" />
45 <recentFiles />
46</JClicSettings>'
47
48library_jclic='<?xml version="1.0" encoding="UTF-8"?>
49<JClicProject name="Sin_nombre" version="0.1.3" type="library">
50 <settings>
51  <title>Biblioteca principal</title>
52  <revision description="created" date="11/8/16" />
53  <descriptors />
54 </settings>
55 <sequence>
56  <item id="main" name="main">
57   <jump action="STOP" id="forward" />
58   <jump action="RETURN" id="back" />
59  </item>
60 </sequence>
61 <activities>
62  <activity class="@panels.Menu" name="main">
63   <description>
64    <p>Menú principal</p>
65   </description>
66   <messages>
67    <cell type="initial">
68     <style />
69     <p>Menú principal</p>
70    </cell>
71   </messages>
72   <settings margin="8" report="false">
73    <container bgColor="0xC0C0C0">
74     <counters time="false" actions="false" score="false" />
75    </container>
76    <window bgColor="0xC0C0C0" border="true" />
77   </settings>
78  </activity>
79 </activities>
80 <mediaBag />
81</JClicProject>'
82
83local_path="/home/$USER/"
84moving_path="/home/$USER/Documents/.moving_profiles"
85jclic_path="JClic/projects"
86
87properties_file=$(echo $edu_xtec_properties|sed -e "s%__alumno__%$USER%g")
88library_file=$library_jclic 
89cfg_file=$(echo $jclic_cfg|sed -e "s%__lib1__%$L_RATOLI%g" -e "s%__lib2__%$L_MESTRE%g" -e "s%__lib3__%$L_MURCIA%g" -e "s%__alumno__%$USER%g" -e "/^\s*$/d")
90
91mkdir -p $moving_path/$jclic_path
92echo $properties_file > $moving_path/.edu.xtec.properties
93echo $library_file > $moving_path/$jclic_path/library.jclic
94echo $cfg_file > $moving_path/JClic/jclic.cfg
95chown $USER:students $moving_path/.edu.xtec.properties
96chown -R $USER:students $moving_path/JClic
97
98mkdir -p $local_path/$jclic_path
99cp $moving_path/.edu.xtec.properties $local_path
100cp -R $moving_path/JClic $local_path
101
102exit 0
Note: See TracBrowser for help on using the repository browser.