HEX
Server: nginx/1.29.3
System: Linux 11979.bigscoots-wpo.com 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64
User: nginx (1068)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_open,proc_close,popen,show_source,cmd# Do not modify this line # 1684243876
Upload Files
File: //bigscoots/cpanel/template_generator.sh
#!/bin/bash

# Define the paths to the different template files
welcome_email_template="/bigscoots/cpanel/templates/welcome_email.txt"
placeholder1_template="/bigscoots/cpanel/templates/placeholder1.txt"
placeholder2_template="/bigscoots/cpanel/templates/placeholder2.txt"

# Display the menu of options
echo "Select a template:"
echo "1. Welcome Email"
echo "2. Placeholder 1"
echo "3. Placeholder 2"
read -p "Enter your choice: " choice

# Determine which template to use based on the user's choice
case $choice in
  1) template_file=$welcome_email_template;;
  2) template_file=$placeholder1_template;;
  3) template_file=$placeholder2_template;;
  *) echo "Invalid choice"; exit 1;;
esac

# Extract the necessary variables from the environment
WHM_URL="${HOSTNAME}"
PORTAL_URL="https://portal.bigscoots.com/clientarea/services/&service=${HOSTNAME%%.*}"
ONE_TIME_LOGIN_URL="$(whmlogin)"
SSH_HOST="${HOSTNAME}"
SSH_PORT="2222"

# Replace placeholders in the template with actual values
template=$(cat "$template_file")
template=${template/\$\{WHM_URL\}/$WHM_URL}
template=${template/\$\{PORTAL_URL\}/$PORTAL_URL}
template=${template/\$\{ONE_TIME_LOGIN_URL\}/$ONE_TIME_LOGIN_URL}
template=${template/\$\{SSH_HOST\}/$SSH_HOST}
template=${template/\$\{SSH_PORT\}/$SSH_PORT}

# Send email using the template
echo
echo
echo
echo "$template"