Command

This executable can run non-interactive system commands.
  1. Comment

    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 .
    

    The --disablerepo=* option is used for targets without Internet connectivity, can be omitted otherwise.

    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    dnf install -y x-1.0-1.noarch.rpm --disablerepo=*