Skip to content

set default /etc/hostname? #7

@Negashev

Description

@Negashev

How i can set defauilt hostname for container

for example?

    if [ ! -z "$HOSTNAME" ]; then
      if [ "$HOSTNAME" = "default" ]; then
            HOSTNAME=`hostname`
            log "Changing Zabbix Hostname to ${bold}${white}${HOSTNAME}${reset}."
            sed -i 's/^[# ]*Hostname=.*$/Hostname='$HOSTNAME'/g' ${TARGET_CONFIG_FILE}
        else
            log "Changing Zabbix Hostname to ${bold}${white}${HOSTNAME}${reset}."
            sed -i 's/^[# ]*Hostname=.*$/Hostname='$HOSTNAME'/g' ${TARGET_CONFIG_FILE}
        fi      
    fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions