[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Logging of commands in a bash script to a file



Use redirects:

$IP route add ${VPN_NET[$N]} dev ${VPN_IFACE[$N]} src ${VPN_IP[$N]} table $N >> /some/log/file
$IP route add default via ${VPN_GW[$N]} table $N >> /some/log/file


$IP route add ${VPN_NET[$N]} dev ${VPN_IFACE[$N]} src ${VPN_IP[$N]} >> /some/log/file

$IP rule add from ${VPN_IP[$N]} table $N >> /some/log/file

That will place the output of those commands (and only those commands) into /some/log/file.
Just make sure you have write permissions to wherever you are redirecting

On 04/22/2014 06:37 PM, Daniel Bareiro wrote:
$IP route add ${VPN_NET[$N]} dev ${VPN_IFACE[$N]} src ${VPN_IP[$N]} table $N
$IP route add default via ${VPN_GW[$N]} table $N

$IP route add ${VPN_NET[$N]} dev ${VPN_IFACE[$N]} src ${VPN_IP[$N]}
$IP rule add from ${VPN_IP[$N]} table $N


Reply to: