#!/bin/bash

. ${TOOLKIT}-functions.sh

echo 1 >/proc/sys/net/ipv4/ip_forward

$SOMETHING_CHANGED && {
	cd /etc/openvpn
	[ -f remotes ] && {
		make	|| exit 1
	} || :

	# 2014.05.12
	# removed because if any problem occurs and running in remote,
	# you are kicked out!
	#
	##restart_service openvpn openvpn || exit 1
}

# cleanup old stuffs
purgefiles /etc/openvpn/config.sample.* /etc/openvpn/old-makeconf.sh

exit 0
