I am creating a script where at the end of it I execute a command that displays a very large output of information. Is it possible to replace this output? That is, instead of it showing the standard output show only one message eg Connected. ?
The command to run would be:
sudo openvpn --config srvproxy-udp-1194-config.ovpn
The output of it is thus typically:
Thu Sep 21 09:48:48 2017 WARNING: file 'srvproxy-udp-1194-tls.key' is group or others accessible Thu Sep 21 09:48:48 2017 OpenVPN 2.4.0 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH / PKTINFO] [AEAD] built on Jun 22 2017 Thu Sep 21 09:48:48 2017 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08 Enter Auth Username: xxxxxx Enter Auth Password: ******* Thu Sep 21 09:48:54 2017 TCP / UDP: Preserving recently used remote address: [AF_INET] 200.210.150.105:1194 Thu Sep 21 09:48:54 2017 UDP local link (bound): [AF_INET] [undef]: 0 Thu Sep 21 09:48:54 2017 UDP link remote: [AF_INET] 200.210.150.105:1194 Thu Sep 21 09:48:54 2017 WARNING: this configuration cache passwords in memory - use the auth-nocache option to prevent this Thu Sep 21 09:48:54 2017 [www.xxxxxxx.com.br] Peer Connection Initiated with [AF_INET] 200.210.150.105:1194 Thu Sep 21 09:48:55 2017 TUN / TAP device tun0 opened Thu Sep 21 09:48:55 2017 do_ifconfig, tt-> did_ifconfig_ipv6_setup = 0 Thu Sep 21 09:48:55 2017 / sbin / ip link set dev tun0 up mtu 1500 Thu Sep 21 09:48:55 2017 / sbin / ip addr add dev tun0 local 172.8.0.6 peer 172.8.0.5 Thu Sep 21 09:48:55 2017 Initialization Sequence Completed