This executable can run non-interactive system commands.
Generate the FreeBSD package with fpm and upload it to the target.
echo /path/to/command >x.sh fpm -n x -s dir -t freebsd -a all --before-install x.sh .
This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
sudo
If there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
sudo VAR=value ...
sudo -E ...
pkg install -y --no-repo-update ./x-1.0.txz
Source | History