i got function in bash script:
function start_vpn() { sudo ip netns exec frootvpn openvpn --config /etc/openvpn/frootvpn.conf & while ! sudo ip netns exec frootvpn ip show dev tun0 up; sleep .5 done } it fails because doesn't stop let me enter private key password. when enter sudo ip netns exec frootvpn openvpn --config /etc/openvpn/frootvpn.conf manually got private key prompt in script doesn't wait me enter :)
if mean sudo password can try
sudo sh -c 'ip netns exec frootvpn openvpn --config /etc/openvpn/frootvpn.conf &' for openvpn password try asking read fifo. echo password fifo. havent tried this.
mkfifo ~/myfifo sudo sh -c 'ip ... openvpn --askpass ~/myfifo ... &' then interactively, if dont want password echoed:
$ stty -echo; cat >~/myfifo; stty echo type password type control-d eof
Comments
Post a Comment