This executable can run non-interactive system commands.
Generate the RPM package with fpm and upload it to the target.
echo /path/to/command >x.sh fpm -n x -s dir -t rpm -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 ...
dnf install -y x-1.0-1.noarch.rpm
Source | History