les recettes ont maintenant l'extension .rr par défaut
This commit is contained in:
parent
a2e863e216
commit
98ba626897
|
@ -158,24 +158,24 @@ function runs_initdir() {
|
||||||
echo "$sysinfost" >"$runshostdir/sysinfos.conf"
|
echo "$sysinfost" >"$runshostdir/sysinfos.conf"
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$runshostdir/default" ]; then
|
if [ ! -f "$runshostdir/default" ]; then
|
||||||
estep "Création de $(ppath "$runshostdir/default")"
|
estep "Création de $(ppath "$runshostdir/default.rr")"
|
||||||
echo "$defaultt" >"$runshostdir/default"
|
echo "$defaultt" >"$runshostdir/default.rr"
|
||||||
edit_default=1
|
edit_default=1
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$runshostdir/config" ]; then
|
if [ ! -f "$runshostdir/config" ]; then
|
||||||
estep "Création de $(ppath "$runshostdir/config")"
|
estep "Création de $(ppath "$runshostdir/config.rr")"
|
||||||
echo "$configt" >"$runshostdir/config"
|
echo "$configt" >"$runshostdir/config.rr"
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$runshostdir/services" ]; then
|
if [ ! -f "$runshostdir/services" ]; then
|
||||||
estep "Création de $(ppath "$runshostdir/services")"
|
estep "Création de $(ppath "$runshostdir/services.rr")"
|
||||||
echo "$servicest" >"$runshostdir/services"
|
echo "$servicest" >"$runshostdir/services.rr"
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$runshostdir/userdefault" ]; then
|
if [ ! -f "$runshostdir/userdefault" ]; then
|
||||||
estep "Création de $(ppath "$runshostdir/userdefault")"
|
estep "Création de $(ppath "$runshostdir/userdefault.rr")"
|
||||||
echo "$userdefaultt" >"$runshostdir/userdefault"
|
echo "$userdefaultt" >"$runshostdir/userdefault.rr"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$edit_default" ] && "${EDITOR:-vi}" "$runshostdir/default"
|
[ -n "$edit_default" ] && "${EDITOR:-vi}" "$runshostdir/default.rr"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -189,9 +189,9 @@ function __runs_create_rscript() {
|
||||||
template="$runsconft"
|
template="$runsconft"
|
||||||
elif [ "$rscriptname" == "sysinfos.conf" ]; then
|
elif [ "$rscriptname" == "sysinfos.conf" ]; then
|
||||||
template="$sysinfost"
|
template="$sysinfost"
|
||||||
elif [ "$rscriptname" == "default" ]; then
|
elif [ "$rscriptname" == "default" -o "$rscriptname" == "default.rr" ]; then
|
||||||
template="$defaultt"
|
template="$defaultt"
|
||||||
elif [ "$rscriptname" == "userdefault" ]; then
|
elif [ "$rscriptname" == "userdefault" -o "$rscriptname" == "userdefault.rr" ]; then
|
||||||
template="$userdefaultt"
|
template="$userdefaultt"
|
||||||
else
|
else
|
||||||
withext "$rscript" || rscript="$rscript.rs"
|
withext "$rscript" || rscript="$rscript.rs"
|
||||||
|
@ -629,11 +629,24 @@ function runs_recipe() {
|
||||||
recipe="$(abspath "$1")"
|
recipe="$(abspath "$1")"
|
||||||
if [ -d "$recipe" ]; then
|
if [ -d "$recipe" ]; then
|
||||||
if is_root; then
|
if is_root; then
|
||||||
|
if [ -f "$recipe/default.rr" ]; then
|
||||||
|
recipe="$recipe/default.rr"
|
||||||
|
elif [ -f "$recipe/default" ]; then
|
||||||
recipe="$recipe/default"
|
recipe="$recipe/default"
|
||||||
else
|
else
|
||||||
|
recipe="$recipe/default.rr"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -f "$recipe/userdefault.rr" ]; then
|
||||||
|
recipe="$recipe/userdefault.rr"
|
||||||
|
elif [ -f "$recipe/userdefault" ]; then
|
||||||
recipe="$recipe/userdefault"
|
recipe="$recipe/userdefault"
|
||||||
|
else
|
||||||
|
recipe="$recipe/userdefault.rr"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
[ ! -f "$recipe" -a -f "$recipe.rr" ] && recipe="$recipe.rr"
|
||||||
if [ ! -f "$recipe" ]; then
|
if [ ! -f "$recipe" ]; then
|
||||||
eerror "$(ppath "$recipe"): fichier introuvable"
|
eerror "$(ppath "$recipe"): fichier introuvable"
|
||||||
return 1
|
return 1
|
||||||
|
@ -724,6 +737,14 @@ function runs_recipepath() {
|
||||||
# pas été trouvé, sinon retourner la valeur de retour de runs_recipe()
|
# pas été trouvé, sinon retourner la valeur de retour de runs_recipe()
|
||||||
local RUNSDIR RUNSSCRIPT RUNSSCRIPTDIR RUNSSCRIPTNAME RUNSDIRPATH RUNSSCRIPTPATH
|
local RUNSDIR RUNSSCRIPT RUNSSCRIPTDIR RUNSSCRIPTNAME RUNSDIRPATH RUNSSCRIPTPATH
|
||||||
local RUNSSCRIPTSDIRS RUNSMODULESDIRS RUNSHOSTSDIRS; __runs_setpath
|
local RUNSSCRIPTSDIRS RUNSMODULESDIRS RUNSHOSTSDIRS; __runs_setpath
|
||||||
|
if [ "${1%.rr}" == "$1" ]; then
|
||||||
|
# essayer d'abord avec l'extension .rr
|
||||||
|
if runs_find_scriptfile "$1"; then
|
||||||
|
runs_recipe "$RUNSSCRIPT"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if ! runs_find_scriptfile "$1"; then
|
if ! runs_find_scriptfile "$1"; then
|
||||||
eerror "$1: fichier introuvable. Vérifiez les valeurs suivantes:
|
eerror "$1: fichier introuvable. Vérifiez les valeurs suivantes:
|
||||||
RUNSSCRIPTSPATH=$RUNSSCRIPTSPATH
|
RUNSSCRIPTSPATH=$RUNSSCRIPTSPATH
|
||||||
|
|
Loading…
Reference in New Issue