HEX
Server: Apache
System: Linux hp3-stn-1011028.hostingp3.local 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: csh958633 (951153)
PHP: 8.3.30
Disabled: shell_exec,exec,system,popen,set_time_limit
Upload Files
File: //usr/local/bin/puprun
#!/usr/bin/env bash

# Detect if running as root and set sudo prefix accordingly
if [[ $EUID -eq 0 ]]; then
    SUDO=""
else
    SUDO="sudo"
fi

if [[ $1 == "-h" ]]; then
    echo "Usage: puprun [OPTIONS]"
    echo "Run 'puppet agent --test' with no arguments."
    echo "-d      Show debugging messages"
    echo "-v      Show verbose messages"
    echo "-h      Show this help message."
elif [[ $1 == "-d" ]]; then
    $SUDO puppet agent --test --debug
elif [[ $1 == "-v" ]]; then
    $SUDO puppet agent --test --verbose
else
    $SUDO puppet agent --test
fi