<commit_before>#!/bin/bash
# Start the contained OpenVPN tunnel if the file client.ovpn exists
# set-up the letsencrypted certificate
#
set -e

if [ ! -f "client.ovpn" ]; then
	# no vpn client configuration, skip everything
	exit 0	
fi

mkdir -p /dev/net
if [ ! -c /dev/net/tun ]; then
    mknod /dev/net/tun c 10 200
fi

openvpn --config client.ovpn --log /elexis/elexis-server/logs/openvpn.log --script-security 2 --up /letsencrypt.sh --daemon<commit_msg>[14871] Consider tun module not loaded<commit_after>#!/bin/bash
# Start the contained OpenVPN tunnel if the file client.ovpn exists
# set-up the letsencrypted certificate
#
set -e

if [ ! -f "client.ovpn" ]; then
	# no vpn client configuration, skip everything
	exit 0	
fi

##
# From https://www.reddit.com/r/synology/comments/74te0y/howto_deploy_openvpn_on_synology_using_docker/
##
# Create the necessary file structure for /dev/net/tun
 if ( [ ! -c /dev/net/tun ] ); then
     if ( [ ! -d /dev/net ] ); then
         mkdir -m 755 /dev/net
     fi
     mknod /dev/net/tun c 10 200
 fi

 if ( !(lsmod | grep -q "^tun\s") ); then
     echo "TUN kernel module not loaded, OpenVPN will not succeed."
     exit -1
 fi

openvpn --config client.ovpn --log /elexis/elexis-server/logs/openvpn.log --script-security 2 --up /letsencrypt.sh --daemon
{'fraction_non_alphanumeric': 0.12654320987654322, 'fraction_numerical': 0.020061728395061727, 'mean_word_length': 2.9663608562691133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5547018', 'n_tokens_mistral': 496, 'n_tokens_neox': 469, 'n_words': 144}