Skip to content

Commit

Permalink
update logging stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cenk1cenk2 committed Jan 19, 2021
1 parent 90bb7ba commit aa5b20a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build/services.d/softether-vpnsrv/run
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ source /scripts/logger.sh

# SOFTETHER START
log_start "Starting Softether Server..."
/s6-bin/softether-vpnsrv/vpnserver start
/s6-bin/softether-vpnsrv/vpnserver start >&/dev/null

# Start DHCP Server
log_start "Starting DHCP server."
/usr/sbin/dnsmasq
/usr/sbin/dnsmasq >&/dev/null

log_divider

Expand All @@ -18,26 +18,26 @@ s6-sleep 3

# Bind to ip address with tap device
log_info "Binded IP address to the server with ${SRVIPSUBNET:-10.0.0}.1"
ip tuntap add dev tap_soft mode tap
/sbin/ifconfig tap_soft ${SRVIPSUBNET:-10.0.0}.1 netmask ${SRVIPNETMASK:-255.255.255.0}
ip tuntap add dev tap_soft mode tap >&/dev/null
/sbin/ifconfig tap_soft ${SRVIPSUBNET:-10.0.0}.1 netmask ${SRVIPNETMASK:-255.255.255.0} >&/dev/null

# Check health
while ping -c 1 -W 10 "${SRVIPSUBNET:-10.0.0}.1" >&/dev/null && pgrep dnsmasq >&/dev/null; do
log_info "[$(date +"%Y%m%d-%H:%M:%S")] Self test success. VPN Server alive and can access ${SRVIPSUBNET:-10.0.0}.1." "top"
log_this "Self test success. VPN Server alive and can access ${SRVIPSUBNET:-10.0.0}.1." "${CYAN}$(date +"%Y%m%d-%H:%M:%S")${RESET}" "INFO" "top"

if [[ -z "${KEEP_SERVER_LOG}" ]]; then
log_info "Clearing up server log files."
rm /usr/local/libexec/softether/vpnserver/server_log/*.log -f
rm /usr/local/libexec/softether/vpnserver/server_log/*.log -f >&/dev/null
fi

if [[ -z "${KEEP_PACKET_LOG}" ]]; then
log_info "Clearing up packet log files."
rm /usr/local/libexec/softether/vpnserver/packet_log/*.log -f
rm /usr/local/libexec/softether/vpnserver/packet_log/*.log -f >&/dev/null
fi

if [[ -z "${KEEP_SECURITY_LOG}" ]]; then
log_info "Clearing up security log files."
rm /usr/local/libexec/softether/vpnserver/packet_log/*.log -f
rm /usr/local/libexec/softether/vpnserver/packet_log/*.log -f >&/dev/null
fi

log_wait "Next check in ${SLEEPTIME:-600} seconds."
Expand Down

0 comments on commit aa5b20a

Please sign in to comment.