close
Warning:
Failed to sync with repository "ogBrowser-Git": (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xA6 I...' for column 'message' at row 1"); repository information may be out of date. Look in the Trac log for more information including mitigation strategies.
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
| Line | |
|---|
| 1 | #!/bin/bash |
|---|
| 2 | |
|---|
| 3 | #_______________________________________________________________________________________________________________________________ |
|---|
| 4 | # |
|---|
| 5 | # Formato de entrada: |
|---|
| 6 | # $1 disco |
|---|
| 7 | # $2 par=Número de particion#cod=Código de partición#sfi=Sistema de ficheros#tam=Tamaño de la partición#ope=Operación$ |
|---|
| 8 | #_______________________________________________________________________________________________________________________________ |
|---|
| 9 | |
|---|
| 10 | particiones=$(echo $2 | awk '{n=split($0,sep,"$");print n}') |
|---|
| 11 | |
|---|
| 12 | declare -a TBP |
|---|
| 13 | declare -a TBF |
|---|
| 14 | for ((par=1;par<$particiones;par++)); |
|---|
| 15 | do |
|---|
| 16 | TBP[$par]=$(echo $2 | awk -v p=$par '{ |
|---|
| 17 | n=split($0,sep,"$"); |
|---|
| 18 | split(sep[p],dua,"#"); |
|---|
| 19 | split(dua[1],prm,"="); |
|---|
| 20 | par=prm[2]; |
|---|
| 21 | split(dua[2],prm,"="); |
|---|
| 22 | cpt=prm[2]; |
|---|
| 23 | split(dua[3],prm,"="); |
|---|
| 24 | sfi=prm[2]; |
|---|
| 25 | split(dua[4],prm,"="); |
|---|
| 26 | tam=prm[2]; |
|---|
| 27 | split(dua[5],prm,"="); |
|---|
| 28 | ope=prm[2]; |
|---|
| 29 | printf("%s %x %s %s %s",par,cpt,sfi,tam,ope); |
|---|
| 30 | }') |
|---|
| 31 | done |
|---|
| 32 | |
|---|
| 33 | # Prepara cadena de particiones _______________________________________ |
|---|
| 34 | cP="" |
|---|
| 35 | for ((par=1;par<$particiones;par++)); |
|---|
| 36 | do |
|---|
| 37 | cfg=${TBP[$par]} |
|---|
| 38 | |
|---|
| 39 | cP=$cP$(echo $cfg | awk '{ |
|---|
| 40 | n=split($0,prm," "); |
|---|
| 41 | par=prm[1]; |
|---|
| 42 | cpt=prm[2]; |
|---|
| 43 | sfi=prm[3]; |
|---|
| 44 | tam=prm[4]; |
|---|
| 45 | ope=prm[5]; |
|---|
| 46 | if(ope==1) |
|---|
| 47 | printf("%s:%s ",sfi,tam); |
|---|
| 48 | else{ |
|---|
| 49 | if(ope==2) |
|---|
| 50 | printf("H%s:%s ",sfi,tam); |
|---|
| 51 | else |
|---|
| 52 | printf("%s:%s ",sfi,tam); |
|---|
| 53 | } |
|---|
| 54 | }') |
|---|
| 55 | |
|---|
| 56 | TBF[$par]=$(echo $cfg | awk '{ |
|---|
| 57 | n=split($0,prm," "); |
|---|
| 58 | sfi=prm[3]; |
|---|
| 59 | ope=prm[5]; |
|---|
| 60 | if(ope==1) |
|---|
| 61 | printf("%s",sfi); |
|---|
| 62 | else |
|---|
| 63 | printf("EMPTY"); |
|---|
| 64 | }') |
|---|
| 65 | |
|---|
| 66 | done |
|---|
| 67 | ogCreatePartitions $1 $cP |
|---|
| 68 | |
|---|
| 69 | # Formatear _______________________________________ |
|---|
| 70 | |
|---|
| 71 | for ((par=1;par<$particiones;par++)); |
|---|
| 72 | do |
|---|
| 73 | sfi=${TBF[$par]} |
|---|
| 74 | if [ $sfi == "EMPTY" ]; then |
|---|
| 75 | TBF[$par]=" " |
|---|
| 76 | else |
|---|
| 77 | ogFormatFs $1 $par $sfi |
|---|
| 78 | fi |
|---|
| 79 | |
|---|
| 80 | done |
|---|
| 81 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.