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

Last change on this file since 3496 was 3496, checked in by mabarracus, 4 years ago

Initial Release

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