This commit is contained in:
fauno
2020-06-13 11:14:12 -03:00
parent 4102f9c168
commit 6c42707f05
2 changed files with 9 additions and 9 deletions

View File

@ -26,7 +26,7 @@
# $2 evento
# $3 script
. "${LVPN_LIBDIR}"/common
. "${RAP_LIBDIR}"/common
# Mostrar los eventos disponibles
list_events() {
@ -37,7 +37,7 @@ list_events() {
# Mostrar los scripts disponibles
list_scripts() {
ls ${LVPN_SKELDIR}/scripts
ls ${RAP_SKELDIR}/scripts
}
VERBOSE=""
@ -68,7 +68,7 @@ for _state in up down; do
# No pisar los tinc-{up,down} con run-script
if test "${event}" != "tinc" ; then
# Copiar una versión moderna de run-script
cp ${VERBOSE} --force "${LVPN_SKELDIR}/run-script" "${node_dir}/"
cp ${VERBOSE} --force "${RAP_SKELDIR}/run-script" "${node_dir}/"
# Y vincularla al evento-estado, de esta forma tenemos una sola copia
# siempre actualizada.
ln --force --symbolic run-script "${node_dir}/${event}-${_state}"

12
rap
View File

@ -43,7 +43,7 @@ export TEXTDOMAIN="$(basename "${RAP}")"
. "${RAP_LIBDIR}/common"
list_commands() {
pushd "${RAP_LIBDIR}" &>/dev/null
pushd "${RAP_EXECDIR}" &>/dev/null
printf '%s\n' *
@ -51,10 +51,10 @@ list_commands() {
}
while getopts "hc" arg; do
case $arg in
h) help rap ; exit 0;;
c) list_commands ; exit 0;;
esac
case $arg in
h) help rap ; exit 0;;
c) list_commands ; exit 0;;
esac
done
let OPTIND--; shift ${OPTIND}
@ -65,7 +65,7 @@ command=$1; shift
# Chequear si el comando existe
if ! test -x "${RAP_EXECDIR}/${command}" ; then
fatal_error "%s no existe, tal vez te gustaría implementarlo :D" ${command}
fatal_error "%s no existe, tal vez te gustaría implementarlo :D" ${command}
fi
# Correr el comando