mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-02 19:49:08 +01:00
Add a postcompile script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
3fbfafb6e3
commit
4f54cb34df
@ -437,6 +437,21 @@ compiler() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Run the postcompile user exit
|
||||||
|
#
|
||||||
|
run_postcompile() { # $1 is the compiled script
|
||||||
|
local script
|
||||||
|
|
||||||
|
script=$(find_file postcompile)
|
||||||
|
|
||||||
|
if [ -n "$script" ]; then
|
||||||
|
. $script $1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Start Command Executor
|
# Start Command Executor
|
||||||
#
|
#
|
||||||
@ -457,6 +472,7 @@ start_command() {
|
|||||||
progress_message3 "Compiling..."
|
progress_message3 "Compiling..."
|
||||||
|
|
||||||
if compiler $g_debugging $nolock compile ${VARDIR}/.start; then
|
if compiler $g_debugging $nolock compile ${VARDIR}/.start; then
|
||||||
|
run_postcompile ${VARDIR}/.start
|
||||||
[ -n "$nolock" ] || mutex_on
|
[ -n "$nolock" ] || mutex_on
|
||||||
run_it ${VARDIR}/.start $g_debugging start
|
run_it ${VARDIR}/.start $g_debugging start
|
||||||
rc=$?
|
rc=$?
|
||||||
@ -666,7 +682,7 @@ compile_command() {
|
|||||||
|
|
||||||
[ "x$file" = x- ] || progress_message3 "Compiling..."
|
[ "x$file" = x- ] || progress_message3 "Compiling..."
|
||||||
|
|
||||||
compiler $g_debugging compile $file
|
compiler $g_debugging compile $file && run_postcompile $file
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -932,6 +948,7 @@ restart_command() {
|
|||||||
progress_message3 "Compiling..."
|
progress_message3 "Compiling..."
|
||||||
|
|
||||||
if compiler $g_debugging $nolock compile ${VARDIR}/.restart; then
|
if compiler $g_debugging $nolock compile ${VARDIR}/.restart; then
|
||||||
|
run_postcompile ${VARDIR}/.restart
|
||||||
[ -n "$nolock" ] || mutex_on
|
[ -n "$nolock" ] || mutex_on
|
||||||
run_it ${VARDIR}/.restart $g_debugging restart
|
run_it ${VARDIR}/.restart $g_debugging restart
|
||||||
rc=$?
|
rc=$?
|
||||||
@ -1023,6 +1040,7 @@ refresh_command() {
|
|||||||
progress_message3 "Compiling..."
|
progress_message3 "Compiling..."
|
||||||
|
|
||||||
if compiler $g_debugging $nolock compile ${VARDIR}/.refresh; then
|
if compiler $g_debugging $nolock compile ${VARDIR}/.refresh; then
|
||||||
|
run_postcompile ${VARDIR}/.refresh
|
||||||
[ -n "$nolock" ] || mutex_on
|
[ -n "$nolock" ] || mutex_on
|
||||||
run_it ${VARDIR}/.refresh $g_debugging refresh
|
run_it ${VARDIR}/.refresh $g_debugging refresh
|
||||||
rc=$?
|
rc=$?
|
||||||
@ -1137,6 +1155,8 @@ safe_commands() {
|
|||||||
exit $status
|
exit $status
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_postcompile ${VARDIR}/.$command
|
||||||
|
|
||||||
case $command in
|
case $command in
|
||||||
start)
|
start)
|
||||||
RESTOREFILE=NONE
|
RESTOREFILE=NONE
|
||||||
@ -1268,6 +1288,8 @@ try_command() {
|
|||||||
exit $status
|
exit $status
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_postcompile ${VARDIR}/.restart
|
||||||
|
|
||||||
case $command in
|
case $command in
|
||||||
start)
|
start)
|
||||||
RESTOREFILE=NONE
|
RESTOREFILE=NONE
|
||||||
|
Loading…
Reference in New Issue
Block a user