0

I'm trying to add the following line into a bash script:

bin/installto.sh /var/www/mail/rc >/dev/null 2>&1

There should be no output, but the upgrade installer requires a yes confirmation:

~/roundcubemail-1.2.1# bin/installto.sh /var/www/mail/rc
Upgrading from 1.1.3. Do you want to continue? (y/N)

Is there any way to have a silent upgrade with an auto yes confirmation like apt-get upgrade -y

Best regards, Aeris

Edit:

I didnt knew the expect command until now
My script:

cd roundcubemail-1.2.1 >/dev/null 2>&1
expect -c 'bin/installto.sh /var/www/mail/rc >/dev/null 2>&1'
expect "Do you want to continue? (y/N)"
send "y"
interact
rm -r /root/roundcubemail-1.2.1/ >/dev/null 2>&1
[...]

---> result

"bin/installto.sh /var/www/mail/rc"
couldn't read file "Do you want to continue? (y/N)": no such file or directory
/root/update.sh: Zeile 104: send: command not found.
/root/update.sh: Zeile 105: interact: command not found.

Aeris
  • 307
  • 5
  • 16

1 Answers1

1

Do you know expect command?

expect -c 'bin/installto.sh /var/www/mail/rc >/dev/null 2>&1'
expect "Do you want to continue? (y/N)"
send "y\n"
interact
David Pérez Cabrera
  • 4,960
  • 2
  • 23
  • 37