New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Need help for a bash script - OVZ container
So, I am writing a simple setup script for ovz container (bash code?), Right now I am stuck at one place,
I have a configuration file that goes like this
Herpy Derp
derp derp
derpy derp
serverip= #
blah blah
blah blah
So now, I need something that would do this
echo serverip= x.x.x.x > /etc/service.conf
and
iptables -t nat -A POSTROUTING -s 1.2.3.0/24 -j SNAT --to "serverip"
How would the script find and replace server ip for both case?
Comments
derp derp
derpy derp
serverip= #
blah blah
blah blah
Is this a template? And you want to replace # with the server ip?
Or is 'service.conf' the above?
Sorry, it's really unclear to me what the flow is supposed to be....
Kinda,
Is there anyway to echo servers main ip inside that config file using commands like ip addr show?
Well
would be replaced by
This is for an auto setup openvpn script.
"Is there anyway to echo servers main ip inside that config file using commands like ip addr show"
OT: I don't know, I will re-read the thread tomorrow and see if i can help you, I am tired. :-(
if you place inside a script you can pass a parameter:
I only guessing still at what you want, but...
template.txt
script.sh
Usage:
I could write it for you, but that would be cheating, use a foreach line statement and awk. If I recall properly you can parse until $1 is your serverip, then read $3 and then that's your IP.
this is professional
exist and
go to school ninja_hawk
http://webhostingfail.com/dewlance-hosting-why-hosting-shouldnt-be-done-by-every-other-kid/
lol, you're promoting our company at free of cost.
Thanks Ninja_Hawk
Free +PR
Free Marketing..
Thanks Ninja_Hawk
You are most welcome kind sir. Now it would be nice if you stop using burstnet before we all get into this dirty game.
Thanks Ninja_Hawk, Now I did not hate you.
Who help you to write this post? profile link?
It's better marketing than you could ever dream of doing.
Unless your clients are as dumb as you they'll know not to touch your farcical "company" with a barge pole.
Unless your clients are as dumb as you they'll know not to touch your farcical "company" with a barge pole.
I don't need your Suggestion
@DewlanceVPS
You make me LOL.
Still going to use Burstnet kunnu?
@Ninja_Hawk
Shame on you, you are DDoSing our server?
Are you kiddin me? I don't play stupid shit. Post your log. BTW, only your site is out while the whole server is up. Trying to frame some one kiddo :P
Here is an OpenVPN script you can make use of: http://vpsnoc.com/blog/tag/openvpn/