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