Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
913eb0b1
authored
Feb 06, 2013
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ubuntu context: added 00networking
parent
e0137de2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
miscellaneous/context/ubuntu/etc/context/init.d/00networking
+28
-0
No files found.
miscellaneous/context/ubuntu/etc/context/init.d/00networking
0 → 100755
View file @
913eb0b1
#!/bin/bash
echo
"En vagyok a
$0
!"
if
!
grep
-qs
-P
'^\s*auto eth0'
/etc/network/interfaces
;
then
arr
=(
$((
echo
'ibase=16'
;
ifconfig eth0
|
awk
'/HWaddr/ {print $5}'
|
tr
':a-z'
'\nA-Z'
)
|
bc
)
)
ipv4
=
"
${
arr
[2]
}
.
${
arr
[3]
}
.
${
arr
[4]
}
.
${
arr
[5]
}
"
gw4
=
"
${
arr
[2]
}
.
${
arr
[3]
}
.255.254"
ipv6
=
"2001:738:2001:4031:
${
arr
[3]
}
:
${
arr
[4]
}
:
${
arr
[5]
}
:0"
gw6
=
"2001:738:2001:4031:
${
arr
[3]
}
:255:254:0"
echo
ok
"
$ipv4
$ipv6
$gw4
$gw6
"
cat
<<
EOF
>> /etc/network/interfaces
auto eth0
iface eth0 inet static
address
$ipv4
netmask 255.255.0.0
gateway
$gw4
dns-nameservers 152.66.243.60
iface eth0 inet6 static
address
$ipv6
netmask 80
gateway
$gw6
EOF
ifconfig eth0
0
;
ifdown eth0
;
ifup eth0
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment