ralfyang / docker_cli_dashboard

CLI mode dashboard for Docker
135 stars 30 forks source link

Update for Shell check(/usr/bin/bash or /usr/bin/sh) of the container #39

Closed ralfyang closed 5 years ago

ralfyang commented 5 years ago
it_container(){
        env_chk=$(${Comm} exec -it ${ProcessorAIDArray[$1]} $Shell_cmd -c "echo \"OK\"" > /tmp/env_chk)
                if [[ $(grep "OK" /tmp/env_chk) != "" ]];then
                        Shell_cmd="/bin/bash"
                else
                        Shell_cmd="/bin/sh"
                fi
        rm -f /tmp/env_chk
        ${Comm} exec -it ${ProcessorAIDArray[$1]} $Shell_cmd -c "echo \"alias ll='ls -lai'\" >> ~/.bashrc && $Shell_cmd"
}