Last active
September 8, 2017 03:42
-
-
Save bartvm/936860ac2955348190d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd openvpn | |
connections=(*.ovpn) | |
i=1 | |
for filename in "${connections[@]}"; do | |
extension="${filename##*.}" | |
base="${filename%.*}" | |
printf -v j "%02d" $((i+10)) | |
mkdir "$j" | |
cp crl.rsa.2048.pem "$j/crl.rsa.2048.pem" | |
cp ca.rsa.2048.crt "$j/ca.rsa.2048.crt" | |
echo "#viscosity name $base" > "$j/config.conf" | |
echo -n "\"$base\", " | |
cat "$filename" >> "$j/config.conf" | |
rm "$filename" | |
i=$((i+1)) | |
done | |
rm crl.rsa.2048.pem | |
rm ca.rsa.2048.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment