Category : expect

The Dockerfile contains: ENV VAR=1 COPY ./setup.exp /tmp/ RUN chmod a+x /tmp/setup.exp The expect file: #!/usr/bin/expect set timeout -1 spawn setup -v expect "Enter variable: " send — "$env(VAR)r" The shell file (main.sh): #!/bin/sh /tmp/setup.exp $VAR When I run ./main.sh from the shell inside the container, it works perfectly fine. However, when I run docker-compose ..

Read more

I’m trying to run expect script in docker container. I’ve installed expect Docker file FROM ubuntu:latest RUN apt-get update && apt-get install expect -y Expect script eval spawn ssh -oStrictHostKeyChecking=no -oCheckHostIP=no [email protected]**** #use correct prompt set prompt “:|#|$” interact -o -nobuffer -re $prompt return send “******r” interact I get the following error bash: spawn: command ..

Read more

docker file content: From freeradius/freeradius-server COPY eccCertImport / RUN apt-get update -y && apt-get install -y expect RUN [“/bin/sh”,”/eccCertImport”] eccCertImport file content: #!/bin/bash +x #!/usr/bin/expect key_passphrase=”test123″; set timeout -1 radius_cert_cmd=”openssl pkcs12 -in radius_ecc_pfx -clcerts -out radius_ecc_cer -nokeys” exp_cmd=”spawn $radius_cert_cmd; expect “Import Password:” send “${key_passphrase}r” interact” result=”$(expect -c “$exp_cmd” | tee -a a.txt)” when I execute ..

Read more