1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

feature #4139: create .monitor file in ssh_make_path

This commit is contained in:
Javi Fontan 2016-04-27 19:39:01 +02:00
parent 3cb5cab021
commit de891f3fb0

View File

@ -433,12 +433,18 @@ EOF
echo "$SSH_EXEC_OUT"
}
#Creates path ($2) at $1
# Creates path ($2) at $1. If third parameter is "monitor" creates the
# file ".monitor" in the directory. Used for ssh disk monitoring
function ssh_make_path
{
SSH_EXEC_ERR=`$SSH $1 sh -s 2>&1 1>/dev/null <<EOF
set -e
if [ ! -d $2 ]; then
mkdir -p $2
if [ "monitor" = "$3" ]; then
touch "$2/.monitor"
fi
fi
EOF`
SSH_EXEC_RC=$?