add the ability to execute a script at the end of the run

This commit is contained in:
Aaron Bieber 2019-10-12 08:40:05 -06:00
parent 22ed04f2b7
commit d93600ace4
Signed by: qbit
GPG Key ID: 279160AB1BE1236B
3 changed files with 16 additions and 0 deletions

View File

@ -103,6 +103,11 @@ The options are as follows:
> pkg\_info(1)
> for more information on fuzzy names.
*$CWD/commands*
> An optional file that contains a script that will be executed at the end of
> the run.
# SEE ALSO
chmod(1),

View File

@ -210,3 +210,11 @@ if [ $MAINTENANCE == 1 ]; then
msg 0 "installing firmware updates"
_ssh ${RUN_USER}@${SERVER} "/usr/sbin/fw_update $V -a"
fi
if [ -f ./commands ]; then
local _tmp=$(mktemp)
rm $_tmp
msg 0 "executing 'commands' file"
_scp commands "${RUN_USER}@${SERVER}:${_tmp}"
_ssh ${RUN_USER}@${SERVER} "chmod +x ${_tmp}; . ${_tmp}"
fi

View File

@ -97,6 +97,9 @@ Package names should be listed by their fuzzy names.
See
.Xr pkg_info 1
for more information on fuzzy names.
.It Pa $CWD/commands
An optional file that contains a script that will be executed at the end of
the run.
.El
.Sh SEE ALSO
.Xr chmod 1 ,