configure-oglivelgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacion
Last change
on this file since 17dc359 was
c28eefa,
checked in by Natalia Serrano <natalia.serrano@…>, 19 months ago
|
Log to syslog in a number of shell scripts
|
-
Property mode set to
100755
|
File size:
1.1 KB
|
Rev | Line | |
---|
[0109c07] | 1 | #!/bin/bash |
---|
| 2 | #/** |
---|
| 3 | # clean-mountdirimage |
---|
| 4 | #@brief Borra los directorios de montaje de las imagenes que no se estén usando. |
---|
| 5 | #@param No |
---|
| 6 | #@return Información sobre los directorios borrardos o no. |
---|
| 7 | #@exception # Usuario distinto de root. |
---|
| 8 | #@version 1.0 |
---|
| 9 | #@author Irina Gomez |
---|
| 10 | #@date 2014-01-20 |
---|
| 11 | #*/ ## |
---|
| 12 | |
---|
[c28eefa] | 13 | PROG=$(basename $0) |
---|
| 14 | OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"} |
---|
| 15 | source $OPENGNSYS/lib/ogfunctions.sh |
---|
| 16 | |
---|
[0109c07] | 17 | BASEDIR="/opt/opengnsys/images/mount" |
---|
| 18 | DIR=$(ls $BASEDIR) |
---|
| 19 | if [ "$USER" != "root" ]; then |
---|
| 20 | echo "$PROG: Error: solo ejecutable por root" >&2 |
---|
| 21 | exit 1 |
---|
| 22 | fi |
---|
| 23 | |
---|
| 24 | # Desmontamos los directorios que no se esten usando. |
---|
| 25 | umount /opt/opengnsys/images/mount/* &>/dev/null |
---|
| 26 | # Guardamos los directorios que siguen montados. |
---|
| 27 | MOUNTEDDIR=$(df |grep /opt/opengnsys/images/mount) |
---|
| 28 | # Comprobamos que no esta montado y borramos. |
---|
[c28eefa] | 29 | echolog "Borrando los directorios de montaje de las imagenes:" |
---|
[0109c07] | 30 | for IMGDIR in $DIR |
---|
| 31 | do |
---|
[c28eefa] | 32 | echolog " $IMGDIR:" |
---|
[0109c07] | 33 | if ! echo $MOUNTEDDIR |grep -e "$BASEDIR/$IMGDIR " -e "$BASEDIR/$IMGDIR$" >/dev/null ; then |
---|
| 34 | rm -rf $BASEDIR/$IMGDIR |
---|
[c28eefa] | 35 | echolog "directorio borrado." |
---|
[0109c07] | 36 | else |
---|
[c28eefa] | 37 | echolog "directorio ocupado, no se puede borrar." |
---|
[0109c07] | 38 | |
---|
| 39 | fi |
---|
| 40 | done |
---|
| 41 | |
---|
| 42 | |
---|
Note: See
TracBrowser
for help on using the repository browser.