[9f577259] | 1 | #!/bin/bash |
---|
| 2 | #/** |
---|
| 3 | #@file Registry.lib |
---|
| 4 | #@brief Librería o clase Registry |
---|
| 5 | #@class Boot |
---|
| 6 | #@brief Funciones para gestión del registro de Windows. |
---|
| 7 | #@version 1.0.1 |
---|
| 8 | #@warning License: GNU GPLv3+ |
---|
| 9 | #*/ |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | #/** |
---|
| 13 | # ogAddRegistryKey path_mountpoint str_hive str_keyname |
---|
| 14 | #@brief Añade una nueva clave al registro de Windows. |
---|
[bf18bcbd] | 15 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
| 16 | #@param str_hive sección del registro |
---|
| 17 | #@param str_keyname nombre de la clave |
---|
| 18 | #@return (nada) |
---|
| 19 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 20 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
| 21 | #@note hive = { default, sam, security, software, system, components } |
---|
| 22 | #@warning Requisitos: chntpw |
---|
| 23 | #@warning El sistema de archivos de Windows debe estar montada previamente. |
---|
[9f577259] | 24 | #@version 1.0.1 - Nueva función |
---|
| 25 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
[cd2ae87] | 26 | #@date 2011-05-25 |
---|
[9f577259] | 27 | #*/ ## |
---|
[1b804cc] | 28 | function ogAddRegistryKey () |
---|
[9f577259] | 29 | { |
---|
[cd2ae87] | 30 | # Variables locales. |
---|
| 31 | local FILE |
---|
[9f577259] | 32 | |
---|
[cd2ae87] | 33 | # Si se solicita, mostrar ayuda. |
---|
| 34 | if [ "$*" == "help" ]; then |
---|
[bf18bcbd] | 35 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive str_key" \ |
---|
| 36 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\NewKey'" |
---|
[cd2ae87] | 37 | return |
---|
| 38 | fi |
---|
| 39 | # Error si no se reciben 3 parámetros. |
---|
| 40 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 41 | # Camino del fichero de registro. |
---|
| 42 | FILE=$(ogGetHivePath "$1" "$2") || return $? |
---|
[9f577259] | 43 | |
---|
[cd2ae87] | 44 | # Añadir nueva clave. |
---|
[367e04d] | 45 | chntpw "$FILE" << EOT &> /dev/null |
---|
[3907aaf] | 46 | cd ${3%\\*} |
---|
| 47 | nk ${3##*\\} |
---|
[cd2ae87] | 48 | q |
---|
| 49 | y |
---|
| 50 | EOT |
---|
[1b804cc] | 51 | } |
---|
| 52 | |
---|
| 53 | #/** |
---|
[9570719] | 54 | # ogAddRegistryValue path_mountpoint str_hive str_valuename [str_valuetype] |
---|
| 55 | #@brief Añade un nuevo valor al registro de Windows, indicando su tipo de datos. |
---|
[bf18bcbd] | 56 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
| 57 | #@param str_hive sección del registro |
---|
| 58 | #@param str_valuename nombre del valor |
---|
| 59 | #@param str_valuetype tipo de datos del valor (opcional) |
---|
| 60 | #@return (nada) |
---|
| 61 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 62 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
| 63 | #@note hive = { default, sam, security, software, system, components } |
---|
| 64 | #@note valuetype = { string, binary, dword }, por defecto: string |
---|
| 65 | #@warning Requisitos: chntpw |
---|
| 66 | #@warning El sistema de archivos de Windows debe estar montada previamente. |
---|
[1b804cc] | 67 | #@version 1.0.1 - Nueva función |
---|
| 68 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
[9570719] | 69 | #@date 2011-05-25 |
---|
[1b804cc] | 70 | #*/ ## |
---|
[cd2ae87] | 71 | function ogAddRegistryValue () |
---|
[1b804cc] | 72 | { |
---|
[9570719] | 73 | # Variables locales. |
---|
| 74 | local FILE TYPE |
---|
| 75 | |
---|
| 76 | # Si se solicita, mostrar ayuda. |
---|
| 77 | if [ "$*" == "help" ]; then |
---|
[bf18bcbd] | 78 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive str_valuename [str_valuetype]" \ |
---|
| 79 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\NewKey\Value1'" \ |
---|
| 80 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\NewKey\Value1' DWORD" |
---|
[9570719] | 81 | return |
---|
| 82 | fi |
---|
| 83 | # Error si no se reciben 3 o 4 parámetros. |
---|
| 84 | [ $# == 3 -o $# == 4 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 85 | # Camino del fichero de registro. |
---|
| 86 | FILE=$(ogGetHivePath "$1" "$2") || return $? |
---|
| 87 | case "$4" in |
---|
| 88 | string|STRING|"") TYPE=1 ;; |
---|
| 89 | binary|BINARY) TYPE=3 ;; |
---|
| 90 | dword|DWORD) TYPE=4 ;; |
---|
| 91 | *) ogRaiseError $OG_ERR_OUTOFLIMIT "$4" |
---|
[367e04d] | 92 | return $? ;; |
---|
[9570719] | 93 | esac |
---|
| 94 | |
---|
| 95 | # Devolver el dato del valor de registro. |
---|
| 96 | # /* (comentario Doxygen) |
---|
[367e04d] | 97 | chntpw "$FILE" << EOT &> /dev/null |
---|
[9570719] | 98 | cd ${3%\\*} |
---|
| 99 | nv $TYPE ${3##*\\} |
---|
| 100 | q |
---|
| 101 | y |
---|
| 102 | EOT |
---|
| 103 | # (comentario Doxygen) */ |
---|
[1b804cc] | 104 | } |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | #/** |
---|
| 108 | # ogDeleteRegistryKey path_mountpoint str_hive str_keyname |
---|
| 109 | #@brief Elimina una clave del registro de Windows con todo su contenido. |
---|
[bf18bcbd] | 110 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
| 111 | #@param str_hive sección del registro |
---|
| 112 | #@param str_keyname nombre de la clave |
---|
| 113 | #@return (nada) |
---|
| 114 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 115 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
| 116 | #@note hive = { default, sam, security, software, system, components } |
---|
| 117 | #@warning Requisitos: chntpw |
---|
| 118 | #@warning El sistema de archivos de Windows debe estar montada previamente. |
---|
| 119 | #@warning La clave debe estar vacía para poder ser borrada. |
---|
[1b804cc] | 120 | #@version 1.0.1 - Nueva función |
---|
| 121 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
[cd2ae87] | 122 | #@date 2011-05-25 |
---|
[1b804cc] | 123 | #*/ ## |
---|
| 124 | function ogDeleteRegistryKey () |
---|
| 125 | { |
---|
[cd2ae87] | 126 | # Variables locales. |
---|
| 127 | local FILE |
---|
| 128 | |
---|
| 129 | # Si se solicita, mostrar ayuda. |
---|
| 130 | if [ "$*" == "help" ]; then |
---|
[bf18bcbd] | 131 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive str_key" \ |
---|
| 132 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\NewKey'" |
---|
[cd2ae87] | 133 | return |
---|
| 134 | fi |
---|
| 135 | # Error si no se reciben 3 parámetros. |
---|
| 136 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 137 | # Camino del fichero de registro. |
---|
| 138 | FILE=$(ogGetHivePath "$1" "$2") || return $? |
---|
| 139 | |
---|
| 140 | # Añadir nueva clave. |
---|
[367e04d] | 141 | chntpw "$FILE" << EOT &> /dev/null |
---|
[3907aaf] | 142 | cd ${3%\\*} |
---|
| 143 | dk ${3##*\\} |
---|
[cd2ae87] | 144 | q |
---|
| 145 | y |
---|
| 146 | EOT |
---|
[1b804cc] | 147 | } |
---|
| 148 | |
---|
| 149 | #/** |
---|
[bf18bcbd] | 150 | # ogDeleteRegistryValue path_mountpoint str_hive str_valuename |
---|
[1b804cc] | 151 | #@brief Elimina un valor del registro de Windows. |
---|
[bf18bcbd] | 152 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
| 153 | #@param str_hive sección del registro |
---|
| 154 | #@param str_valuename nombre del valor |
---|
| 155 | #@return (nada) |
---|
| 156 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 157 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
| 158 | #@note hive = { default, sam, security, software, system, components } |
---|
| 159 | #@warning Requisitos: chntpw |
---|
| 160 | #@warning El sistema de archivos de Windows debe estar montada previamente. |
---|
[1b804cc] | 161 | #@version 1.0.1 - Nueva función |
---|
| 162 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
[cd2ae87] | 163 | #@date 2011-05-25 |
---|
[1b804cc] | 164 | #*/ ## |
---|
| 165 | function ogDeleteRegistryValue () |
---|
| 166 | { |
---|
[cd2ae87] | 167 | # Variables locales. |
---|
| 168 | local FILE |
---|
| 169 | |
---|
| 170 | # Si se solicita, mostrar ayuda. |
---|
| 171 | if [ "$*" == "help" ]; then |
---|
[bf18bcbd] | 172 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive str_valuename" \ |
---|
| 173 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\NewKey\Value1'" |
---|
[cd2ae87] | 174 | return |
---|
| 175 | fi |
---|
| 176 | # Error si no se reciben 3 parámetros. |
---|
| 177 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 178 | # Camino del fichero de registro. |
---|
| 179 | FILE=$(ogGetHivePath "$1" "$2") || return $? |
---|
| 180 | |
---|
| 181 | # Devolver el dato del valor de registro. |
---|
| 182 | # /* (comentario Doxygen) |
---|
[367e04d] | 183 | chntpw "$FILE" << EOT &> /dev/null |
---|
[cd2ae87] | 184 | cd ${3%\\*} |
---|
| 185 | dv ${3##*\\} |
---|
| 186 | q |
---|
| 187 | y |
---|
| 188 | EOT |
---|
| 189 | # (comentario Doxygen) */ |
---|
[1b804cc] | 190 | } |
---|
| 191 | |
---|
| 192 | |
---|
| 193 | #/** |
---|
| 194 | # ogGetHivePath path_mountpoint str_hive |
---|
[9f577259] | 195 | #@brief Función básica que devuelve el camino del fichero con una sección del registro. |
---|
| 196 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
| 197 | #@param str_hive sección del registro |
---|
| 198 | #@return str_path - camino del fichero de registro |
---|
| 199 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
[bf18bcbd] | 200 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
[9f577259] | 201 | #@note hive = { default, sam, security, software, system, components } |
---|
| 202 | #@warning El sistema de archivos de Windows debe estar montada previamente. |
---|
| 203 | #@version 1.0.1 - Nueva función |
---|
| 204 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 205 | #@date 2011-05-18 |
---|
| 206 | #*/ ## |
---|
[1b804cc] | 207 | function ogGetHivePath () |
---|
[9f577259] | 208 | { |
---|
| 209 | # Variables locales. |
---|
| 210 | local FILE FILENT FILEXP |
---|
| 211 | |
---|
| 212 | # Si se solicita, mostrar ayuda. |
---|
| 213 | if [ "$*" == "help" ]; then |
---|
| 214 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive" |
---|
[bf18bcbd] | 215 | "$FUNCNAME /mnt/sda1 SOFTWARE" |
---|
[9f577259] | 216 | return |
---|
| 217 | fi |
---|
| 218 | # Error si no se reciben 2 parámetros. |
---|
| 219 | [ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 220 | |
---|
| 221 | # Camino del fichero de registro en NT/2000 o XP/Vista/7. |
---|
| 222 | FILENT=$(ogGetPath "/$1/winnt/system32/config/$2") |
---|
| 223 | [ -f $FILENT ] && FILE="$FILENT" |
---|
| 224 | FILEXP=$(ogGetPath "/$1/windows/system32/config/$2") |
---|
| 225 | [ -f $FLEHXP ] && FILE="$FILEXP" |
---|
| 226 | [ ! -f $FILE ] && ogRaiseError OG_ERR_NOTFOUND "$1,$2" && return $? |
---|
| 227 | |
---|
| 228 | echo "$FILE" |
---|
| 229 | } |
---|
| 230 | |
---|
| 231 | |
---|
| 232 | #/** |
---|
| 233 | # ogGetRegistryValue path_mountpoint str_hive str_valuename |
---|
| 234 | #@brief Devuelve el dato de un valor del registro de Windows. |
---|
| 235 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
| 236 | #@param str_hive sección del registro |
---|
| 237 | #@param str_valuename nombre del valor |
---|
| 238 | #@return str_valuedata - datos del valor. |
---|
| 239 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
[bf18bcbd] | 240 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
[9f577259] | 241 | #@note hive = { default, sam, security, software, system, components } |
---|
| 242 | #@warning Requisitos: chntpw, awk |
---|
[bf18bcbd] | 243 | #@warning El sistema de archivos de Windows debe estar montado previamente. |
---|
[9f577259] | 244 | #@version 0.9 - Adaptación para OpenGNSys. |
---|
| 245 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 246 | #@date 2009-09-11 |
---|
| 247 | #*/ ## |
---|
| 248 | function ogGetRegistryValue () |
---|
| 249 | { |
---|
| 250 | # Variables locales. |
---|
| 251 | local FILE |
---|
| 252 | |
---|
| 253 | # Si se solicita, mostrar ayuda. |
---|
| 254 | if [ "$*" == "help" ]; then |
---|
[bf18bcbd] | 255 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive str_valuename" \ |
---|
| 256 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\NewKey\Value1' ==> 1" |
---|
[9f577259] | 257 | return |
---|
| 258 | fi |
---|
| 259 | # Error si no se reciben 3 parámetros. |
---|
| 260 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 261 | # Camino del fichero de registro. |
---|
[1b804cc] | 262 | FILE=$(ogGetHivePath "$1" "$2") || return $? |
---|
[9f577259] | 263 | |
---|
| 264 | # Devolver el dato del valor de registro. |
---|
| 265 | # /* (comentario Doxygen) |
---|
[367e04d] | 266 | chntpw "$FILE" << EOT 2> /dev/null | awk '/> Value/ {getline;print $0;}' |
---|
[9f577259] | 267 | cd ${3%\\*} |
---|
| 268 | cat ${3##*\\} |
---|
| 269 | q |
---|
[cd2ae87] | 270 | EOT |
---|
[9f577259] | 271 | # (comentario Doxygen) */ |
---|
| 272 | } |
---|
| 273 | |
---|
| 274 | |
---|
| 275 | #/** |
---|
[3907aaf] | 276 | # ogListRegistryKeys path_mountpoint str_hive str_key |
---|
| 277 | #@brief Lista los nombres de subclaves de una determinada clave del registro de Windows. |
---|
[9f577259] | 278 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
| 279 | #@param str_hive sección del registro |
---|
| 280 | #@param str_key clave de registro |
---|
| 281 | #@return str_subkey ... - lista de subclaves |
---|
| 282 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
[bf18bcbd] | 283 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
[9f577259] | 284 | #@note hive = { default, sam, security, software, system, components } |
---|
| 285 | #@warning Requisitos: chntpw, awk |
---|
[bf18bcbd] | 286 | #@warning El sistema de archivos de Windows debe estar montado previamente. |
---|
[9f577259] | 287 | #@version 0.9 - Adaptación para OpenGNSys. |
---|
| 288 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 289 | #@date 2009-09-23 |
---|
| 290 | #*/ ## |
---|
[3907aaf] | 291 | function ogListRegistryKeys () |
---|
[9f577259] | 292 | { |
---|
| 293 | # Variables locales. |
---|
| 294 | local FILE |
---|
| 295 | |
---|
| 296 | # Si se solicita, mostrar ayuda. |
---|
| 297 | if [ "$*" == "help" ]; then |
---|
[bf18bcbd] | 298 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive str_key" \ |
---|
| 299 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\Windows\CurrentVersion'" |
---|
[9f577259] | 300 | return |
---|
| 301 | fi |
---|
| 302 | # Error si no se reciben 3 parámetros. |
---|
| 303 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 304 | |
---|
| 305 | # Camino del fichero de registro. |
---|
[1b804cc] | 306 | FILE=$(ogGetHivePath "$1" "$2") || return $? |
---|
[9f577259] | 307 | |
---|
| 308 | # Devolver la lista de claves de registro. |
---|
[367e04d] | 309 | chntpw "$FILE" << EOT 2> /dev/null | awk 'BEGIN {FS="[<>]"} $1~/^ $/ {print $2}' |
---|
[9f577259] | 310 | ls $3 |
---|
| 311 | q |
---|
[9570719] | 312 | EOT |
---|
[9f577259] | 313 | } |
---|
| 314 | |
---|
| 315 | |
---|
| 316 | #/** |
---|
[3907aaf] | 317 | # ogListRegistryValues path_mountpoint str_hive str_key |
---|
| 318 | #@brief Lista los nombres de valores de una determinada clave del registro de Windows. |
---|
[bf18bcbd] | 319 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
| 320 | #@param str_hive sección del registro |
---|
| 321 | #@param str_key clave de registro |
---|
| 322 | #@return str_value ... - lista de valores |
---|
| 323 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 324 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
| 325 | #@note hive = { default, sam, security, software, system, components } |
---|
| 326 | #@warning Requisitos: chntpw, awk |
---|
| 327 | #@warning El sistema de archivos de Windows debe estar montado previamente. |
---|
[3907aaf] | 328 | #@version 1.0.1 - Nueva función. |
---|
| 329 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 330 | #@date 2011-05-26 |
---|
| 331 | #*/ ## |
---|
| 332 | function ogListRegistryValues () |
---|
| 333 | { |
---|
| 334 | # Variables locales. |
---|
| 335 | local FILE |
---|
| 336 | |
---|
| 337 | # Si se solicita, mostrar ayuda. |
---|
| 338 | if [ "$*" == "help" ]; then |
---|
[bf18bcbd] | 339 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive str_key" \ |
---|
| 340 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\Windows\CurrentVersion'" |
---|
[3907aaf] | 341 | return |
---|
| 342 | fi |
---|
| 343 | # Error si no se reciben 3 parámetros. |
---|
| 344 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 345 | # Camino del fichero de registro. |
---|
| 346 | FILE=$(ogGetHivePath "$1" "$2") || return $? |
---|
| 347 | |
---|
| 348 | # Devolver la lista de claves de registro. |
---|
[367e04d] | 349 | chntpw "$FILE" << EOT 2> /dev/null | awk 'BEGIN {FS="[<>]"} $1~/REG_/ {print $2}' |
---|
[3907aaf] | 350 | ls $3 |
---|
| 351 | q |
---|
| 352 | EOT |
---|
| 353 | } |
---|
| 354 | |
---|
| 355 | |
---|
| 356 | #/** |
---|
[9f577259] | 357 | # ogSetRegistryValue path_mountpoint str_hive str_valuename str_valuedata |
---|
| 358 | #@brief Establece el dato asociado a un valor del registro de Windows. |
---|
| 359 | #@param path_mountpoint directorio donde está montado el sistema Windows |
---|
[bf18bcbd] | 360 | #@param str_hive sección del registro |
---|
[9f577259] | 361 | #@param str_valuename nombre del valor de registro |
---|
| 362 | #@param str_valuedata dato del valor de registro |
---|
| 363 | #@return (nada) |
---|
| 364 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
[bf18bcbd] | 365 | #@exception OG_ERR_NOTFOUND Fichero de registro no encontrado. |
---|
[9f577259] | 366 | #@note hive = { default, sam, security, software, system, components } |
---|
[bf18bcbd] | 367 | #@warning Requisitos: chntpw |
---|
| 368 | #@warning El sistema de archivos de Windows debe estar montado previamente. |
---|
[9f577259] | 369 | #@version 0.9 - Adaptación para OpenGNSys. |
---|
| 370 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 371 | #@date 2009-09-24 |
---|
| 372 | #*/ ## |
---|
| 373 | function ogSetRegistryValue () |
---|
| 374 | { |
---|
| 375 | # Variables locales. |
---|
| 376 | local FILE |
---|
| 377 | |
---|
| 378 | # Si se solicita, mostrar ayuda. |
---|
| 379 | if [ "$*" == "help" ]; then |
---|
| 380 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_hive str_valuename str_data" |
---|
[bf18bcbd] | 381 | "$FUNCNAME /mnt/sda1 SOFTWARE '\Microsoft\NewKey\Value1' 1" |
---|
[9f577259] | 382 | return |
---|
| 383 | fi |
---|
| 384 | # Error si no se reciben 4 parámetros. |
---|
| 385 | [ $# == 4 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 386 | # Camino del fichero de registro. |
---|
[1b804cc] | 387 | FILE=$(ogGetHivePath "$1" "$2") || return $? |
---|
[9f577259] | 388 | |
---|
| 389 | # Cambiar el dato del valor de registro. |
---|
[367e04d] | 390 | chntpw "$FILE" << EOT &> /dev/null |
---|
| 391 | cd ${3%\\*} |
---|
| 392 | ed ${3##*\\} |
---|
[9f577259] | 393 | $4 |
---|
| 394 | q |
---|
| 395 | y |
---|
[9570719] | 396 | EOT |
---|
[9f577259] | 397 | } |
---|
| 398 | |
---|