|
@@ -21,7 +21,7 @@
|
|
|
# Logging helpers #
|
|
|
###################################################################################
|
|
|
|
|
|
-LOGFILE="/var/log/ynh-vpnclient.log"
|
|
|
+LOGFILE="/var/log/vpnclient/ynh-vpnclient.log"
|
|
|
touch $LOGFILE
|
|
|
chown root:root $LOGFILE
|
|
|
chmod 600 $LOGFILE
|
|
@@ -187,15 +187,15 @@ case "$action" in
|
|
|
if systemctl start openvpn@client.service; then
|
|
|
success "OpenVPN client started!"
|
|
|
else
|
|
|
- tail -n 20 /var/log/openvpn-client.log | tee -a $LOGFILE
|
|
|
+ tail -n 20 /var/log/vpnclient/openvpn-client.log | tee -a $LOGFILE
|
|
|
critical "Failed to start OpenVPN client"
|
|
|
fi
|
|
|
|
|
|
info "Waiting for tun0 interface to show up"
|
|
|
- openvpn_log_start=$(find_last_line_number "process exiting" /var/log/openvpn-client.log)
|
|
|
- if ! timeout 180 tail -n-${openvpn_log_start} -f /var/log/openvpn-client.log 2>/dev/null | grep -q "TUN/TAP device tun0 opened"; then
|
|
|
+ openvpn_log_start=$(find_last_line_number "process exiting" /var/log/vpnclient/openvpn-client.log)
|
|
|
+ if ! timeout 180 tail -n-${openvpn_log_start} -f /var/log/vpnclient/openvpn-client.log 2>/dev/null | grep -q "TUN/TAP device tun0 opened"; then
|
|
|
error "The VPN client didn't open tun0 interface"
|
|
|
- tail -n 20 /var/log/openvpn-client.log | tee -a $LOGFILE
|
|
|
+ tail -n 20 /var/log/vpnclient/openvpn-client.log | tee -a $LOGFILE
|
|
|
critical "Failed to start OpenVPN client"
|
|
|
fi
|
|
|
|
|
@@ -203,14 +203,14 @@ case "$action" in
|
|
|
success "tun0 interface is up!"
|
|
|
else
|
|
|
error "tun0 interface did not show up, most likely an issue happening in OpenVPN client"
|
|
|
- tail -n 20 /var/log/openvpn-client.log | tee -a $LOGFILE
|
|
|
+ tail -n 20 /var/log/vpnclient/openvpn-client.log | tee -a $LOGFILE
|
|
|
critical "Failed to start OpenVPN client"
|
|
|
fi
|
|
|
|
|
|
info "Waiting for VPN client to be ready..."
|
|
|
- if ! timeout 180 tail -n-${openvpn_log_start} -f /var/log/openvpn-client.log 2>/dev/null | grep -q "Initialization Sequence Completed"; then
|
|
|
+ if ! timeout 180 tail -n-${openvpn_log_start} -f /var/log/vpnclient/openvpn-client.log 2>/dev/null | grep -q "Initialization Sequence Completed"; then
|
|
|
error "The VPN client didn't complete initiliasation"
|
|
|
- tail -n 20 /var/log/openvpn-client.log | tee -a $LOGFILE
|
|
|
+ tail -n 20 /var/log/vpnclient/openvpn-client.log | tee -a $LOGFILE
|
|
|
critical "Failed to start OpenVPN client"
|
|
|
fi
|
|
|
|