source: client/engine/PostConfEAC.lib @ c3531ef

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since c3531ef was 7747e66, checked in by ramon <ramongomez@…>, 10 years ago

Mover antiguas funciones de EAC a la librería PostConfEAC.

git-svn-id: https://opengnsys.es/svn/branches/version1.1@4705 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 17.3 KB
Line 
1#!/bin/bash
2
3#         ogLoadHiveWindows int_ndisk int_partiton
4#@brief   Localiza los hive del registro de windows (de sistema y usuarios)
5#@param   int_ndisk      nº de orden del disco
6#@param   int_partition     nº de particion
7#@return 
8#@exception OG_ERR_FORMAT    Formato incorrecto.
9#@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar.
10#@version 0.9 - Adaptación a OpenGNSys.
11#@author  Antonio J. Doblas Viso. Universidad de Málaga
12#@date    2009-09-24
13#*/ ##
14
15
16function ogLoadHiveWindows () {
17# Variables locales.
18local PART DISK
19
20# Si se solicita, mostrar ayuda.
21if [ "$*" == "help" ]; then
22    ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_partition" \
23           "$FUNCNAME 1 1 "
24    return
25fi     
26
27# Error si no se reciben 2 parámetros.
28[ $# == 2 ] || return $(ogRaiseError $OG_ERR_FORMAT; echo $?)
29
30DISK=$1; PART=$2;
31
32#Comprobaciones redundantes: borrar"
33#ogDiskToDev $DISK $PART || return $(ogRaiseError $OG_ERR_PARTITION "particion de windows no detectada"; echo $?)
34#ogGetOsType $DISK $PART | grep "Windows" || return $(ogRaiseError $OG_ERR_NOTOS "no es windows"; echo $?)
35#VERSION=$(ogGetOsVersion $DISK $PART)
36#Fin Comprobaciones redundantes: borrar"
37
38
39# primera fase, carga de los hive del sistema
40if ogGetPath $DISK $PART WINDOWS
41then
42        SYSTEMROOT="Windows"
43elif ogGetPath $DISK $PART WINNT
44then
45        SYSTEMROOT="winnt"
46else
47        return $(ogRaiseError $OG_ERR_NOTOS "version windows no detectada"; echo $?)
48fi
49
50hiveSAM=$(ogGetPath $DISK $PART /${SYSTEMROOT}/system32/config/SAM) && export hiveSAM || return $(ogRaiseError $OG_ERR_NOTOS " hive SAM  no detectada"; echo $?)
51hiveSYSTEM=$(ogGetPath $DISK $PART /${SYSTEMROOT}/system32/config/system) && export hiveSYSTEM || return $(ogRaiseError $OG_ERR_NOTOS "hive SYSTEM  no detectada"; echo $?)
52hiveSOFTWARE=$(ogGetPath $DISK $PART /${SYSTEMROOT}/system32/config/software) && export hiveSOFTWARE || return $(ogRaiseError $OG_ERR_NOTOS "hive SOFTWARE no detectada"; echo $?)
53export TEMPhive=/tmp/tmpregistry
54
55# segunda fase, carga de los hive de usuarios windows.
56declare -i COUNT
57COUNT=3
58#TODO WINDOWS XP WINDOWS7
59BASEHOMEDIR=$(ogGetPath $DISK $PART /"Documents and Settings")
60TMPUSERFILE="/tmp/WuserRegAndDAT.tmp"
61find "$BASEHOMEDIR/" -type f -name NTUSER.DAT > $TMPUSERFILE 
62LISTUSERS=$(drbl-chntpw -l $hiveSAM | grep RID | awk -F"<" '{print $2}' | awk -F">" '{print $1}')
63#echo "$BASEHOMEDIR" $LISTUSERS
64for user in $LISTUSERS
65do                     
66        # Comprobamos que el usuario registrado tiene .DAT
67                if HOMEDIR=$(cat $TMPUSERFILE | grep -w $user) 
68                then
69                        #echo "$user exportamos los usuarios de windows como variables, y como valor hiveUSERX; donde la X es 3 4 5 6 ... X"
70                        export `echo $user=hiveUSER$COUNT`
71                        #echo "$user exportamos la variable hiveUSERX con el valor del home de la variable-usuario_windows"
72                        ##export `echo hiveUSER$COUNT`="$(echo $HOMEDIR | sed -e 's/ /\\ /'g | sed -e 's/\\/\\\\/g')"
73                        export `echo hiveUSER$COUNT`="$(echo $HOMEDIR)"
74                        #echo " estas variables \$USUARIO -> Identificador del HIVE ; \${!USUARIO} -> path del HIVE "
75                        COUNT=${COUNT}+1
76                fi
77               
78done
79COUNT=0
80}
81
82
83#         ogUpdateHiveWindows 
84#@brief   Actualiza los hive de windows.
85#@param   int_ndisk       
86#@param   int_partition     
87#@return 
88#@exception OG_ERR_FORMAT    Formato incorrecto.
89#@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar.
90#@version 0.9 - Adaptación a OpenGNSys.
91#@author  Antonio J. Doblas Viso. Universidad de Málaga
92#@date    2009-09-24
93#*/ ##
94
95
96function ogUpdateHiveWindows (){
97# Variables locales.
98local PART DISK FILE
99
100#TODO detectar llamada a ogLoadHiveWindows
101
102# Si se solicita, mostrar ayuda.
103if [ "$*" == "help" ]; then
104    ogHelp "$FUNCNAME" "$FUNCNAME " \
105           "$FUNCNAME  "
106    return
107fi     
108
109echo drbl-chntpw -f $TEMPhive $hiveSAM $hiveSYSTEM $hiveSOFTWARE \"${hiveUSER3}\" \"${hiveUSER4}\" \"${hiveUSER5}\" \"${hiveUSER6}\" \"${hiveUSER7}\" \"${hiveUSER8}\" \"${hiveUSER9}\" > /tmp/run.sh
110cat /tmp/run.sh; sh /tmp/run.sh; rm -fr $TEMPhive; rm /tmp/run.sh
111
112unset hiveSAM hiveSYSTEM hiveSOFTWARE TEMPhive hiveUSER3 hiveUSER4 hiveUSER5 hiveUSER6 hiveUSER7 hiveUSER8 hiveUSER9
113 
114
115}
116
117
118
119function ogHiveNTRunMachine () {
120#echo sintaxis:  PathScripts idScripts
121#echo ejemplo:   c:\\\\WINDOSWS\\\\crearusuarios.bat  scripts1
122#echo IMPORTANTE: el path debe llevar dos barras \\, pero como se deben 'escapar' debes poner cuatro \\\\
123#echo "identifica 0=$hiveSAM 1=$hiveSystem 2=$hiveSoftware 3=$HiveUser3"
124
125local PART DISK FILE
126
127# Si se solicita, mostrar ayuda.
128if [ "$*" == "help" ]; then
129    ogHelp "$FUNCNAME" "$FUNCNAME PathScripts|command keyName " \
130           "$FUNCNAME c:\\\\Windows\\\\crearusuarios.cmd scripts_crearUsuarios "\
131           "$FUNCNAME "cmd /c del c:\ogboot.*" ogcleanboot "\
132           "$FUNCNAME Requiere la previa ejecución de ogLoadHive int_disk int_part"\
133           "$FUNCNAME Despues requiere el ogUpdateHive"
134    return
135fi     
136       
137
138# Error si no se reciben al menos 1 parámetros.
139[ $# == 2 ] || return $(ogRaiseError $OG_ERR_FORMAT; echo $?)   
140
141
142cat >> $TEMPhive << EOF
143h 2
144cd \Microsoft\Windows\CurrentVersion\Run
145nv 1 $2
146ed $2
147$1
148EOF
149#ogGetRegistryValue /mnt/sda1 software '\Microsoft\Windows\CurrentVersion\Run\og3'
150}
151
152function ogNTPolUserOn () {
153
154# Si se solicita, mostrar ayuda.
155if [ "$*" == "help" ]; then
156    ogHelp "$FUNCNAME" "$FUNCNAME id_hive_user " \
157           "$FUNCNAME NombreUsuario"\
158           "$FUNCNAME "
159    return
160fi             
161
162# TODO: error si no se ha llamado previamente a ogLoadHiveWindows
163[ -n $hiveSAM ] || return $(ogRaiseError $OG_ERR_FORMAT "se debe utilizar primero la utilidad ogLoadHiveWindows"; echo $?)
164
165# TODO: error si el usuario no tiene cuenta en windows.
166drbl-chntpw -l $hiveSAM | grep RID | grep -w $1 || return $(ogRaiseError $OG_ERR_FORMAT "el usuario $1 no tiene cuenta en este windows: Compruebe mayusculas o minusculas"; echo $?)
167
168# TODO: error si no el usario no no tiene HIVE asociado.
169[ -n "${!1}" ] || return $(ogRaiseError $OG_ERR_FORMAT "el usuario no tiene hive creado"; echo $?)
170
171
172HIVEID=$(echo ${!1} | tr -d "hiveUSER")
173
174
175#echo "IMPORTANTE:  la variable HiveUser3=/mnt/windows/Document/\ and/\ Seeting\alumnmos\NTUSER.dat"
176echo $HIVEID
177#cp /var/EAC/admin/utilswin/Fondo.BMP ${particion}/WINDOWS/
178
179cat >> $TEMPhive << EOF
180h $HIVEID
181cd \Control Panel\Desktop
182ed Wallpaper
183C:\\WINDOWS\\fondo.bmp
184
185cd \Software\Microsoft\Windows\CurrentVersion\Policies
186nk Explorer
187cd Explorer
188
189nv 4 NoDesktop
190ed NoDesktop
1911
192
193nv 4 NoSimpleStartMenu
194ed NoSimpleStartMenu
1951
196nv 4 NoWindowsUpdate
197ed NoWindowsUpdate
1981
199
200nv 4 NoSMConfigurePrograms
201ed NoSMConfigurePrograms
2021
203
204nv 4 NoChangeStartMenu
205ed NoChangeStartMenu
2061
207
208nv 4 Intellimenus
209ed Intellimenus
2101
211
212nv 4 NoRun
213ed NoRun
2141
215
216nv 4 NoRecentDocsHistory
217ed NoRecentDocsHistory
2181
219EOF
220}
221
222
223
224
225
226##########################################################
227##########################################################
228#####librerias de PostConfiguracion v0.1para Advanced Deploy enViorenment###########
229# Liberado bajo licencia GPL <http://www.gnu.org/licenses/gpl.html>################
230############# 2008 Antonio Jes�s Doblas Viso  adv@uma.es ##########################
231########### Universidad de Malaga (Spain)############################
232##########################################################
233
234
235
236
237
238function NTChangeName () {
239if [ $# = 0 ]
240then
241echo sintaxis: NTChangeNAME str_$var
242echo ejemplos: NTCHangeName adi${IPcuatro}-xp
243fi
244cat >> $temporal << EOF
245h 1
246ed ControlSet001\Control\ComputerName\ComputerName\ComputerName
247$1
248ed ControlSet001\Services\Tcpip\Parameters\Hostname
249$1
250ed ControlSet001\Services\Tcpip\Parameters\NV Hostname
251$1
252h 2
253cd \Microsoft\Windows NT\CurrentVersion\Winlogon
254ed DefaultDomainName
255$1
256EOF
257}
258
259
260
261function NTSetGroupName () {
262if [ $# = 0 ]
263then
264echo sintaxis: NTSetGroupName str_$var
265echo ejemplos: NTSetGroupName adi
266fi
267cat >> $temporal << EOF
268h 2
269ed \Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName
270$1
271EOF
272}
273
274
275function NTSetOwner (){
276if [ $# = 0 ]
277then
278echo sintaxis: NtSetOwner str_propietario str_organizacion
279echo ejemplos: NTSetOwner eu\ politecnica universidad\ de\ malaga
280fi
281cat >> $temporal << EOF
282h 2
283ed \Microsoft\Windows NT\CurrentVersion\RegisteredOwner
284$1
285ed \Microsoft\Windows NT\CurrentVersion\RegisteredOrganization
286$2
287EOF
288}
289
290
291function NTAutoLogon (){
292if [ $# = 0 ]
293then
294echo sintaxis: Int_Activar Int_nves str_usuario str_passwd str_equipo
295echo ejemplos: 1 2 administrador 3451 $equipo
296echo IMPORTANTE: cuando AutoLogonCount llegue a 0, activa el AutoAdminLogon a 0. Pero no borra los valores de DefaultPassword
297return 2
298fi
299#echo la pass es $4
300export temporal=/tmp/tmpregistry
301cat >> $temporal << EOF
302hive 2
303cd \Microsoft\Windows NT\CurrentVersion\Winlogon
304nv 1 AutoAdminLogon
305ed AutoAdminLogon
306$1
307nv 1 AutoLogonCount
308ed AutoLogonCount
309$2
310nv 1 DefaultUserName
311ed DefaultUserName
312$3
313nv 1 DefaultDomainName
314ed DefaultDomainName
315$5
316EOF
317if [ "$4" == none ]
318then
319echo "debe aparecer done" $4
320cat >> $temporal << EOF
321dv DefaultPassword
322
323
324EOF
325else
326cat >> $temporal << EOF
327nv 1 DefaultPassword
328ed DefaultPassword
329$4
330EOF
331fi
332}
333
334function NTStatusRatonTeclado (){
335if [ $# = 0 ]
336then
337echo sintaxis: Int-StatusRaton Int-StatusTeclado
338echo ejemplos:  int=1 activo   int=4 desactivado
339return 2
340fi
341cat >> $temporal << EOF
342hive 1
343cd \ControlSet001\Services\Mouclass
344ed Start
345$1
346cd \ControlSet001\Services\Kbdclass
347ed Start
348$2
349EOF
350}
351
352function NTRunOnceMachine () {
353if [ $# = 0 ]
354then
355echo sintaxis:  PathScripts idScripts
356echo "ejemplo:   c:\\\\WINDOSWS\\\\crearusuarios.bat  scripts1"
357echo "IMPORTANTE: el path debe llevar dos barras \\, pero como se deben 'escapar' debes poner cuatro \\\\"
358return 2
359fi
360export temporal=/tmp/tmpregistry
361cat >> $temporal << EOF
362h 2
363cd \Microsoft\Windows\CurrentVersion\RunOnce
364nv 1 $2
365ed $2
366$1
367EOF
368}
369
370function NTRunMachine () {
371if [ $# = 0 ]
372then
373echo sintaxis:  PathScripts idScripts
374echo ejemplo:   c:\\\\WINDOSWS\\\\crearusuarios.bat  scripts1
375echo IMPORTANTE: el path debe llevar dos barras \\, pero como se deben 'escapar' debes poner cuatro \\\\
376return 2
377fi
378export temporal=/tmp/tmpregistry
379cat >> $temporal << EOF
380h 2
381cd \Microsoft\Windows\CurrentVersion\Run
382nv 1 $2
383ed $2
384$1
385EOF
386}
387
388function NTRunUser () {
389if [ $# = 0 ]
390then
391echo sintaxis:  str_PathWINScripts str_idScripts Int_hive||\$usuario
392echo ejemplo:   c:\\\\WINDOSWS\\\\crearusuarios.bat  scripts1 3
393echo IMPORTANTE: el pathWIN debe llevar dos barras \\, pero como se deben 'escapar' debes poner cuatro \\\\
394echo IMPORTANTE: el pathLinux si lleva espacios debe escaparse con una barra \\
395echo IMPORTANTE Int_hive: 3 para el primer usuario, 4 para el segundo usuario
396echo requiere export un HiveUser3=/mnt/windows/Document\ and\ Seeting\alumnmos\NTUSER.dat
397return 2
398fi
399cat >> $temporal << EOF
400h $3
401cd \Software\Microsoft\Windows\CurrentVersion\Run
402nv 1 $2
403ed $2
404$1
405EOF
406}
407
408
409
410function NTPolUserOn () {
411if [ $# = 0 ]
412then
413Msg "requiere LoadRegistryUser str_user1 str_user2..." orange
414echo "sintaxis:  Int_hive"
415echo "ejemplo: NTPolUserOn 3"
416echo "IMPORTANTE:  la variable HiveUser3=/mnt/windows/Document/\ and/\ Seeting\alumnmos\NTUSER.dat"
417return 2
418fi
419cp /var/EAC/admin/utilswin/Fondo.BMP ${particion}/WINDOWS/
420cat >> $temporal << EOF
421h $1
422cd \Control Panel\Desktop
423ed Wallpaper
424C:\\WINDOWS\\fondo.bmp
425
426cd \Software\Microsoft\Windows\CurrentVersion\Policies
427nk Explorer
428cd Explorer
429
430nv 4 NoDesktop
431ed NoDesktop
4321
433
434nv 4 NoSimpleStartMenu
435ed NoSimpleStartMenu
4361
437nv 4 NoWindowsUpdate
438ed NoWindowsUpdate
4391
440
441nv 4 NoSMConfigurePrograms
442ed NoSMConfigurePrograms
4431
444
445nv 4 NoChangeStartMenu
446ed NoChangeStartMenu
4471
448
449nv 4 Intellimenus
450ed Intellimenus
4511
452
453nv 4 NoRun
454ed NoRun
4551
456
457nv 4 NoRecentDocsHistory
458ed NoRecentDocsHistory
4591
460EOF
461}
462
463function NTPolUserOFF () {
464if [ $# = 0 ]
465then
466Msg "requiere LoadRegistryUser str_user1 str_user2..." orange
467echo "sintaxis:  Int_hive"
468echo "ejemplo: NTPolUserOFF 3"
469echo "IMPORTANTE:  la variable HiveUser3=/mnt/windows/Document/\ and/\ Seeting\alumnmos\NTUSER.dat"
470return 2
471fi
472cat >> $temporal << EOF
473h $1
474cd \Control Panel\Desktop
475ed Wallpaper
476C:\\WINDOWS\\web\\wallpaper\\Felicidad.bmp
477
478cd \Software\Microsoft\Windows\CurrentVersion\
479rdel Policies
480nk Policies
4811
482EOF
483}
484
485
486function ogSetWindowsChkdisk() {
487if [ $# = 0 ]
488then
489echo sintaxis: true|TRUE|0 false|false|1
490echo ejemplos:  int=0 desactivado int=1 activado
491return 2
492fi
493case $1 in
494        0|true|TRUE)
495                valor="autocheck autochk *";;
496        1|false|FALSE)         
497                valor="none";;
498        *)
499                return 0 ;;
500esac
501
502cat >> $TEMPhive << EOF
503hive 1
504cd \ControlSet001\Control\Session Manager
505ed BootExecute
506$valor
507--n
508EOF
509}
510
511
512
513### FASE DE PRUEBAS  NO FUNCIONA
514function NTStartRecovery () {
515if [ $# = 0 ]
516then
517        echo sintaxis: Int-Status
518        echo ejemplos:  int=0 desactivado int=1 activado
519        return 2
520fi
521
522[ $1 = 0 ] && valor="none"
523[ $1 = 1 ] && valor="00000000"
524
525
526cat >> $TEMPhive << EOF
527hive 2
528#cd \Policies\Microsoft\Windows\WinRE
529#ed DisableSetup
530cd \Policies\Microsoft\Windows
531nk WinRE
532nv 4 DisableSetup
533ed DisableSetup
534$valor
535--n
536EOF
537
538
539#Activado
540#[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRE]
541#"DisableSetup"=-
542
543# Desactivado
544#[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRE]
545#"DisableSetup"=dword:00000000
546
547
548}
549
550
551function ogSchrootLinux () {
552
553# Variables locales.
554local PART DISK DIRCONF SCHROOTDEVICE
555
556# Si se solicita, mostrar ayuda.
557if [ "$*" == "help" ]; then
558    ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_partition" \
559           "$FUNCNAME 1 1 "
560    return
561fi     
562
563# Error si no se reciben 2 parámetros.
564[ $# == 2 ] || return $(ogRaiseError $OG_ERR_FORMAT; echo $?)
565
566DISK=$1; PART=$2; DIRCONF="/etc/schroot"
567
568
569VERSION=$(ogGetOsVersion $DISK $PART)
570echo $VERSION | grep "Linux" || return $(ogRaiseError $OG_ERR_NOTOS "no es linux"; echo $?)
571
572ogUnmount $DISK $PART || return $(ogRaiseError $OG_ERR_NOTOS "no es linux"; echo $?)
573
574SCHROOTDEVICE=$(ogDiskToDev $DISK $PART)
575
576
577rm ${DIRCONF}/mount-defaults
578rm ${DIRCONF}/schroot.conf
579
580cat >> ${DIRCONF}/mount-defaults << EOF
581# <file system> <mount point>   <type>  <options>       <dump>  <pass>
582proc            /proc           proc    defaults        0       0
583/dev            /dev            none    rw,bind         0       0
584/dev/pts        /dev/pts        none    rw,bind         0       0
585/dev/shm        /dev/shm        none    rw,bind         0       0
586EOF
587
588
589cat >> ${DIRCONF}/schroot.conf << EOF
590[linux]
591description=$VERSION
592type=block-device
593device=$SCHROOTDEVICE
594EOF
595
596
597
598
599schroot -c linux
600
601schroot -end-sessiona --all-sessions
602}
603
604
605#/**  @function ogDiskToRelativeDev: @brief Traduce los ID de discos o particiones EAC a ID Linux relativos, es decir 1 1 => sda1
606#@param  Admite 1 parametro:   $1  int_numdisk
607#@param  Admite 2 parametro:   $1   int_numdisk                    $2  int_partition
608#@return  Para 1 parametros traduce Discos Duros: Devuelve la ruta relativa linux del disco duro indicado con nomenclatura EAC.........ejemplo: IdPartition 1 => sda
609#@return  Para 2 parametros traduce Particiones: Devuelve la ruta relativa linux de la particion indicado con nomenclatura EAC...........  ejemplo: IdPartition  2 1 => sdb1
610#@warning  No definidas
611#@attention
612#@note    Notas sin especificar
613#@version 0.1 -  Integracion para Opengnsys  -  EAC:  IdPartition en ATA.lib
614#@author  Antonio J. Doblas Viso. Universidad de Malaga
615#@date    27/10/2008
616#*/
617function ogDiskToRelativeDev () {
618if [ $# = 0 ]
619then
620        Msg "Info: Traduce el identificador del dispositivo EAC a dispositivo linux \n" info
621        Msg "Sintaxis1: IdPartition int_disk -----------------Ejemplo1: IdPartition 1 -> sda " example
622        Msg "Sintaxis2: IdPartition int_disk int_partition  --Ejemplo2: IdPartition 1 2 -> sda2 " example
623
624return
625fi
626#PART="$(Disk|cut -f$1 -d' ')$2"    # se comenta esta linea porque doxygen no reconoce la funcion disk y no crea los enlaces y referencias correctas.
627PART=$(ogDiskToDev|cut -f$1 -d' ')$2
628echo $PART | cut -f3 -d \/
629}
630
631
632#/**  @function ogDeletePartitionsLabels: @brief Elimina la informacion que tiene el kernel del cliente og sobre los labels de los sistemas de archivos
633#@param  No requiere
634#@return   Nada
635#@warning
636#@attention Requisitos:  comando interno linux rm
637#@note
638#@version 0.1 -  Integracion para Opengnsys  -  EAC:   DeletePartitionTable()  en ATA.lib
639#@author  Antonio J. Doblas Viso. Universidad de Malaga
640#@date    27/10/2008
641#*/
642function ogDeletePartitionsLabels () {
643# Si se solicita, mostrar ayuda.
644if [ "$*" == "help" ]; then
645    ogHelp "$FUNCNAME" "$FUNCNAME " \
646           "$FUNCNAME "
647    return
648fi
649
650rm /dev/disk/by-label/*    # */ COMENTARIO OBLIGATORIO PARA DOXYGEN
651}
652
653
654#/**  @function ogInfoCache: @brief muestra la informacion de la CACHE.
655#@param  sin parametros
656#@return  texto que se almacena en $IP.-InfoCache.  punto_montaje, tama?oTotal, TamanioOcupado, TaminioLibre, imagenes dentro de la cahce
657#@warning  Salidas de errores no determinada
658#@warning   printf no soportado por busybox
659#@attention
660#@version 0.1   Date: 27/10/2008 Author Antonio J. Doblas Viso. Universidad de Malaga
661#*/
662function ogInfoCache ()
663{
664local info infoFilesystem infoSize infoUsed infoUsedPorcet infoMountedOn content
665if ogMountCache
666then
667        info=`df -h | grep $OGCAC`
668        infoFilesystem=`echo $info | cut -f1 -d" "`
669        infoSize=`echo $info | cut -f2 -d" "`
670        infoUsed=`echo $info | cut -f3 -d" "`
671        infoAvail=`echo $info | cut -f4 -d" "`
672        infoUsedPorcet=`echo $info | cut -f5 -d" "`
673        infoMountedOn=`echo $info | cut -f2 -d" "`
674        if `ls  ${OGCAC}$OGIMG > /dev/null 2>&1`
675        then
676               cd ${OGCAC}${OPENGNSYS}
677                #content=`find images/ -type f -printf "%h/  %f  %s \n"`   busybox no soporta printf
678                content=`find images/ -type f`
679                cd /
680                echo $info
681                echo -ne $content
682                echo " "
683                #echo "$info" > ${OGLOG}/${IP}-InfoCache
684                #echo "$content" >> {$OGLOG}/${IP}-InfoCache
685        else
686                echo $info
687                #echo "$info" > {$OGLOG}/${IP}-InfoCache
688        fi
689        ogUnmountCache
690else
691        echo " "
692        #echo " " > {$OGLOG}/${IP}-InfoCache
693
694fi
695}
696
Note: See TracBrowser for help on using the repository browser.