Script to create a openVPN .conf file for OpenWRT with multiple client configuration
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm trying to automatically generate, from hundreds of files(ovpn client configurations), a config file for openVPN on a openWRT router.
My problem is that I have hundreds of connection and I need the ability to choose between each one every time I start. To do that I need a configuration file that points to each one of those files.
I've been trying to figure out how to generate this file for a long time but no luck from google.
Example of Configuration:
config openvpn '*filenamewithoutdots*'
option config '/etc/openvpn/*filename*'
option enabled '1'
So if I I have these files in a folder:
server1.domain.com.ovpn
server2.domain.com.ovpn
server3.domain.com.ovpn
the script should return a configuration file like this
config openvpn 'server1domaincomovpn'
option config '/etc/openvpn/server1.domain.com.ovpn'
option enabled '1'
config openvpn 'server2domaincomovpn'
option config '/etc/openvpn/server2.domain.com.ovpn'
option enabled '1'
config openvpn 'server3domaincomovpn'
option config '/etc/openvpn/server3.domain.com.ovpn'
option enabled '1'
Bonus points if it removes the extension from the first line as well. But to work it needs all symbols removed in the first line. Alternatively(if simpler) it can put in the first line just the text till the point
more info:
1. the files are openvpn configuration files, but their content is not relevant.
2. Filenames are added in the configuration files, the files then are side loaded on the router in a different folder.
Any idea?
thanks in advance
configuration openvpn openwrt text
add a comment |Â
up vote
0
down vote
favorite
I'm trying to automatically generate, from hundreds of files(ovpn client configurations), a config file for openVPN on a openWRT router.
My problem is that I have hundreds of connection and I need the ability to choose between each one every time I start. To do that I need a configuration file that points to each one of those files.
I've been trying to figure out how to generate this file for a long time but no luck from google.
Example of Configuration:
config openvpn '*filenamewithoutdots*'
option config '/etc/openvpn/*filename*'
option enabled '1'
So if I I have these files in a folder:
server1.domain.com.ovpn
server2.domain.com.ovpn
server3.domain.com.ovpn
the script should return a configuration file like this
config openvpn 'server1domaincomovpn'
option config '/etc/openvpn/server1.domain.com.ovpn'
option enabled '1'
config openvpn 'server2domaincomovpn'
option config '/etc/openvpn/server2.domain.com.ovpn'
option enabled '1'
config openvpn 'server3domaincomovpn'
option config '/etc/openvpn/server3.domain.com.ovpn'
option enabled '1'
Bonus points if it removes the extension from the first line as well. But to work it needs all symbols removed in the first line. Alternatively(if simpler) it can put in the first line just the text till the point
more info:
1. the files are openvpn configuration files, but their content is not relevant.
2. Filenames are added in the configuration files, the files then are side loaded on the router in a different folder.
Any idea?
thanks in advance
configuration openvpn openwrt text
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to automatically generate, from hundreds of files(ovpn client configurations), a config file for openVPN on a openWRT router.
My problem is that I have hundreds of connection and I need the ability to choose between each one every time I start. To do that I need a configuration file that points to each one of those files.
I've been trying to figure out how to generate this file for a long time but no luck from google.
Example of Configuration:
config openvpn '*filenamewithoutdots*'
option config '/etc/openvpn/*filename*'
option enabled '1'
So if I I have these files in a folder:
server1.domain.com.ovpn
server2.domain.com.ovpn
server3.domain.com.ovpn
the script should return a configuration file like this
config openvpn 'server1domaincomovpn'
option config '/etc/openvpn/server1.domain.com.ovpn'
option enabled '1'
config openvpn 'server2domaincomovpn'
option config '/etc/openvpn/server2.domain.com.ovpn'
option enabled '1'
config openvpn 'server3domaincomovpn'
option config '/etc/openvpn/server3.domain.com.ovpn'
option enabled '1'
Bonus points if it removes the extension from the first line as well. But to work it needs all symbols removed in the first line. Alternatively(if simpler) it can put in the first line just the text till the point
more info:
1. the files are openvpn configuration files, but their content is not relevant.
2. Filenames are added in the configuration files, the files then are side loaded on the router in a different folder.
Any idea?
thanks in advance
configuration openvpn openwrt text
I'm trying to automatically generate, from hundreds of files(ovpn client configurations), a config file for openVPN on a openWRT router.
My problem is that I have hundreds of connection and I need the ability to choose between each one every time I start. To do that I need a configuration file that points to each one of those files.
I've been trying to figure out how to generate this file for a long time but no luck from google.
Example of Configuration:
config openvpn '*filenamewithoutdots*'
option config '/etc/openvpn/*filename*'
option enabled '1'
So if I I have these files in a folder:
server1.domain.com.ovpn
server2.domain.com.ovpn
server3.domain.com.ovpn
the script should return a configuration file like this
config openvpn 'server1domaincomovpn'
option config '/etc/openvpn/server1.domain.com.ovpn'
option enabled '1'
config openvpn 'server2domaincomovpn'
option config '/etc/openvpn/server2.domain.com.ovpn'
option enabled '1'
config openvpn 'server3domaincomovpn'
option config '/etc/openvpn/server3.domain.com.ovpn'
option enabled '1'
Bonus points if it removes the extension from the first line as well. But to work it needs all symbols removed in the first line. Alternatively(if simpler) it can put in the first line just the text till the point
more info:
1. the files are openvpn configuration files, but their content is not relevant.
2. Filenames are added in the configuration files, the files then are side loaded on the router in a different folder.
Any idea?
thanks in advance
configuration openvpn openwrt text
edited Dec 6 '17 at 15:08
asked Dec 6 '17 at 15:00
Beagleboys
13
13
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409231%2fscript-to-create-a-openvpn-conf-file-for-openwrt-with-multiple-client-configura%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password