chercher aussi les scripts dans le sous-répertoire runs dans les répertoires d'hôte
This commit is contained in:
parent
a5f6893e2b
commit
a2e863e216
|
@ -99,7 +99,7 @@ function runs_initdir() {
|
||||||
# d'abord chercher si le répertoire existe déjà
|
# d'abord chercher si le répertoire existe déjà
|
||||||
for runshostdir in "${RUNSHOSTSDIRS[@]}"; do
|
for runshostdir in "${RUNSHOSTSDIRS[@]}"; do
|
||||||
found=
|
found=
|
||||||
for dir in "$runshostdir/$domain/$hostname" "$runshostdir/$host"; do
|
for dir in "$runshostdir/$host/runs" "$runshostdir/$domain/$hostname/runs" "$runshostdir/$host" "$runshostdir/$domain/$hostname"; do
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
found=1
|
found=1
|
||||||
break
|
break
|
||||||
|
@ -121,18 +121,18 @@ function runs_initdir() {
|
||||||
found=
|
found=
|
||||||
for dir in "$runshostdir/$host" "$runshostdir/$domain/$hostname"; do
|
for dir in "$runshostdir/$host" "$runshostdir/$domain/$hostname"; do
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
runshostdir="$dir"
|
runshostdir="$dir/runs"
|
||||||
found=1
|
found=1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
[ -n "$found" ] || runshostdir="$runshostdir/$host"
|
[ -n "$found" ] || runshostdir="$runshostdir/$host/runs"
|
||||||
else
|
else
|
||||||
runshostdir="${RUNSHOSTSDIRS[0]}/$host"
|
runshostdir="${RUNSHOSTSDIRS[0]}/$host/runs"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
host="$hostname"
|
host="$hostname"
|
||||||
runshostdir="${RUNSHOSTSDIRS[0]}/$host"
|
runshostdir="${RUNSHOSTSDIRS[0]}/$host/runs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local rscriptt runsconft sysinfost defaultt configt servicest
|
local rscriptt runsconft sysinfost defaultt configt servicest
|
||||||
|
@ -241,7 +241,7 @@ function runs_create_rscript() {
|
||||||
splithost "$host" hostname domain
|
splithost "$host" hostname domain
|
||||||
for runsdir in "${RUNSHOSTSDIRS[@]}"; do
|
for runsdir in "${RUNSHOSTSDIRS[@]}"; do
|
||||||
found=
|
found=
|
||||||
for dir in "$runsdir/$host" "$runsdir/$domain/$hostname"; do
|
for dir in "$runsdir/$host/runs" "$runsdir/$domain/$hostname/runs" "$runsdir/$host" "$runsdir/$domain/$hostname"; do
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
runsdir="$dir"
|
runsdir="$dir"
|
||||||
found=1
|
found=1
|
||||||
|
@ -370,6 +370,8 @@ function runs_find_hostfile() {
|
||||||
splithost "$__runshost" __hostname __domain
|
splithost "$__runshost" __hostname __domain
|
||||||
for __runsdir in "${!__runshostsdirs}"; do
|
for __runsdir in "${!__runshostsdirs}"; do
|
||||||
for __runsfile in \
|
for __runsfile in \
|
||||||
|
"$__runsdir/$__runshost/runs/$__hostfile" \
|
||||||
|
"$__runsdir/$__domain/$__hostname/runs/$__hostfile"\
|
||||||
"$__runsdir/$__runshost/$__hostfile" \
|
"$__runsdir/$__runshost/$__hostfile" \
|
||||||
"$__runsdir/$__domain/$__hostname/$__hostfile"; do
|
"$__runsdir/$__domain/$__hostname/$__hostfile"; do
|
||||||
if [ -e "$__runsfile" ]; then
|
if [ -e "$__runsfile" ]; then
|
||||||
|
@ -417,6 +419,8 @@ function runs_find_datafile() {
|
||||||
splithost "$__runshost" __hostname __domain
|
splithost "$__runshost" __hostname __domain
|
||||||
for __runsdir in "${!__runshostsdirs}"; do
|
for __runsdir in "${!__runshostsdirs}"; do
|
||||||
for __runsfile in \
|
for __runsfile in \
|
||||||
|
"$__runsdir/$__runshost/runs/$__datafile" \
|
||||||
|
"$__runsdir/$__domain/$__hostname/runs/$__datafile"\
|
||||||
"$__runsdir/$__runshost/$__datafile" \
|
"$__runsdir/$__runshost/$__datafile" \
|
||||||
"$__runsdir/$__domain/$__hostname/$__datafile"; do
|
"$__runsdir/$__domain/$__hostname/$__datafile"; do
|
||||||
if [ -e "$__runsfile" ]; then
|
if [ -e "$__runsfile" ]; then
|
||||||
|
@ -497,6 +501,8 @@ function runs_find_scriptfile() {
|
||||||
splithost "$__runshost" __hostname __domain
|
splithost "$__runshost" __hostname __domain
|
||||||
for __runsdir in "${!__runshostsdirs}"; do
|
for __runsdir in "${!__runshostsdirs}"; do
|
||||||
for __runsfile in \
|
for __runsfile in \
|
||||||
|
"$__runsdir/$__runshost/runs/$__scriptfile" \
|
||||||
|
"$__runsdir/$__domain/$__hostname/runs/$__scriptfile" \
|
||||||
"$__runsdir/$__runshost/$__scriptfile" \
|
"$__runsdir/$__runshost/$__scriptfile" \
|
||||||
"$__runsdir/$__domain/$__hostname/$__scriptfile"; do
|
"$__runsdir/$__domain/$__hostname/$__scriptfile"; do
|
||||||
if [ ! -f "$__runsfile" -a -f "$__runsfile.rs" ]; then
|
if [ ! -f "$__runsfile" -a -f "$__runsfile.rs" ]; then
|
||||||
|
@ -541,6 +547,16 @@ function runs_find_scriptfile_reverse() {
|
||||||
if [ -n "$__runshost" ]; then
|
if [ -n "$__runshost" ]; then
|
||||||
splithost "$__runshost" __hostname __domain
|
splithost "$__runshost" __hostname __domain
|
||||||
for __runsdir in "${!__runshostsdirs}"; do
|
for __runsdir in "${!__runshostsdirs}"; do
|
||||||
|
__prefix="$__runsdir/$__runshost/runs/"
|
||||||
|
if [ "${__runsscript#$__prefix}" != "$__runsscript" ]; then
|
||||||
|
runs_initvars "$__runsscript" "$__runsdir" "$__prefix" "${__runsscript#$__prefix/}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
__prefix="$__runsdir/$__domain/$__hostname/runs/"
|
||||||
|
if [ "${__runsscript#$__prefix}" != "$__runsscript" ]; then
|
||||||
|
runs_initvars "$__runsscript" "$__runsdir" "$__prefix" "${__runsscript#$__prefix/}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
__prefix="$__runsdir/$__runshost/"
|
__prefix="$__runsdir/$__runshost/"
|
||||||
if [ "${__runsscript#$__prefix}" != "$__runsscript" ]; then
|
if [ "${__runsscript#$__prefix}" != "$__runsscript" ]; then
|
||||||
runs_initvars "$__runsscript" "$__runsdir" "$__prefix" "${__runsscript#$__prefix/}"
|
runs_initvars "$__runsscript" "$__runsdir" "$__prefix" "${__runsscript#$__prefix/}"
|
||||||
|
|
2
runs
2
runs
|
@ -277,6 +277,8 @@ elif [ "$action" == "list" ]; then
|
||||||
rscriptpaths=()
|
rscriptpaths=()
|
||||||
if [ -n "$runshost" ]; then
|
if [ -n "$runshost" ]; then
|
||||||
for runsdir in "${RUNSHOSTSDIRS[@]}"; do
|
for runsdir in "${RUNSHOSTSDIRS[@]}"; do
|
||||||
|
find_items rscriptpaths "$runsdir/$runshost/runs"
|
||||||
|
find_items rscriptpaths "$runsdir/$domain/$hostname/runs"
|
||||||
find_items rscriptpaths "$runsdir/$runshost"
|
find_items rscriptpaths "$runsdir/$runshost"
|
||||||
find_items rscriptpaths "$runsdir/$domain/$hostname"
|
find_items rscriptpaths "$runsdir/$domain/$hostname"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue