Convertir ses fichiers de configuration .ovpn et .conf en fichier de configuration TunnelBlick .tblk

#!/bin/bash
#
# OpenVPN Configuration files converter to TunnelBlick files
# Support .conf and .ovpn
#
# Author: http://root.sx
# Usage: - Put the script in the directory who contains the conf/ovpn files
#        - Make it executable ($ chmod +x converter.sh)
#        - Execute it ($ ./converter.sh)
# License: Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
#          http://creativecommons.org/licenses/by-nc-sa/3.0/
#


for FILE in *.{ovpn,conf}
do
	echo "Converting $FILE"
	NAME=$FILE
	NAME=`echo ${NAME// /_}`
	NAME=`echo ${NAME//(/}`
	NAME=`echo ${NAME//)/}`
	NAME=`echo ${NAME//[/}`
	NAME=`echo ${NAME//]/}`
	DIR=$(basename "$NAME")
	DIR="${DIR%.*}"
	mkdir $DIR 2>/dev/null
	mv "$FILE" $DIR 2>/dev/null
	cp */*.crt $DIR 2>/dev/null || cp *.crt $DIR 2>/dev/null
	cp */*.key $DIR 2>/dev/null || cp *.key $DIR 2>/dev/null
	mv $DIR "$DIR.tblk" 2>/dev/null
	echo "done...$DIR.tblk"
done

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_bye.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_good.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_negative.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_scratch.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_wacko.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_yahoo.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_cool.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_heart.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_rose.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_smile.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_whistle3.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_yes.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_cry.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_mail.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_sad.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_unsure.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_wink.gif