Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
18a17416
authored
Feb 09, 2013
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
context: fixes #42
parent
08eb1894
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
27 deletions
+56
-27
miscellaneous/context/ubuntu/etc/context/cleanup.conf
+8
-0
miscellaneous/context/ubuntu/etc/context/cleanup.sh
+10
-2
miscellaneous/context/ubuntu/etc/context/init.d/00networking
+23
-18
miscellaneous/context/ubuntu/etc/context/init.d/02sshfs
+1
-0
miscellaneous/context/ubuntu/etc/context/init.d/03profile
+3
-1
miscellaneous/context/ubuntu/etc/context/init.sh
+11
-6
No files found.
miscellaneous/context/ubuntu/etc/context/cleanup.conf
0 → 100644
View file @
18a17416
description
"cleanup.sh"
start
on
runlevel
[
2345
]
stop
on
runlevel
[!
2345
]
post
-
stop
script
/
etc
/
context
/
cleanup
.
sh
end
script
miscellaneous/context/ubuntu/etc/context/cleanup.sh
View file @
18a17416
#!/bin/bash
#!/bin/bash
#rm -f /etc/ssh/ssh_host_*
if
[
!
-f
/run/context-cleanup
]
;
then
exit
0
fi
stop rsyslog
stop rsyslog
rm
-fr
/home/cloud/.bash_history /root/.bash_history /var/log/
*
echo
-e
"auto lo
\n
iface lo inet loopback
\n
"
>
/etc/network/interfaces
sed
-i
's/^<volume user=.*//'
/etc/security/pam_mount.conf.xml
rm
-rf
~cloud/
{
.bash_history,.ssh/id_rsa
}
rm
-rf
~root/
{
.bash_history
}
rm
-rf
/etc/ssh/ssh_host_
*
miscellaneous/context/ubuntu/etc/context/init.d/00networking
View file @
18a17416
...
@@ -2,27 +2,32 @@
...
@@ -2,27 +2,32 @@
echo
"En vagyok a
$0
!"
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
)
)
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]
}
"
ipv4
=
"
${
arr
[2]
}
.
${
arr
[3]
}
.
${
arr
[4]
}
.
${
arr
[5]
}
"
gw4
=
"
${
arr
[2]
}
.
${
arr
[3]
}
.255.254"
gw4
=
"
${
arr
[2]
}
.
${
arr
[3]
}
.255.254"
ipv6
=
"2001:738:2001:4031:
${
arr
[3]
}
:
${
arr
[4]
}
:
${
arr
[5]
}
:0"
ipv6
=
"2001:738:2001:4031:
${
arr
[3]
}
:
${
arr
[4]
}
:
${
arr
[5]
}
:0"
gw6
=
"2001:738:2001:4031:
${
arr
[3]
}
:255:254:0"
gw6
=
"2001:738:2001:4031:
${
arr
[3]
}
:255:254:0"
echo
ok
"
$ipv4
$ipv6
$gw4
$gw6
"
echo
ok
"
$ipv4
$ipv6
$gw4
$gw6
"
cat
<<
EOF
>> /etc/network/interfaces
/
etc/init.d/network-manager stop
ifdown eth0
||
ifconfig eth0
0
down
cat
>
/
etc/network/interfaces
<<
EOF
auto lo
iface lo inet loopback
auto eth0
auto eth0
iface eth0 inet static
iface eth0 inet static
address
$ipv4
address
$ipv4
netmask 255.255.0.0
netmask 255.255.0.0
gateway
$gw4
gateway
$gw4
dns-nameservers 152.66.243.60
dns-nameservers 152.66.243.60
iface eth0 inet6 static
iface eth0 inet6 static
address
$ipv6
address
$ipv6
netmask 80
netmask 80
gateway
$gw6
gateway
$gw6
EOF
EOF
ifconfig eth0
0
;
ifdown eth0
;
ifup eth0
fi
ifup eth0
miscellaneous/context/ubuntu/etc/context/init.d/02sshfs
View file @
18a17416
...
@@ -8,4 +8,5 @@ chmod 600 "$HOME/.ssh/id_rsa"
...
@@ -8,4 +8,5 @@ chmod 600 "$HOME/.ssh/id_rsa"
mkdir
"
$HOME
/sshfs"
mkdir
"
$HOME
/sshfs"
chown
"
$USER
:
$USER
"
-R
"
$HOME
"
chown
"
$USER
:
$USER
"
-R
"
$HOME
"
sed
-i
's/^<volume user=.*//'
/etc/security/pam_mount.conf.xml
sed
-i
"s/^
\(
<
\/
pam_mount>.*
\)
/<volume user=
\"
$USER
\"
fstype=
\"
fuse
\"
path=
\"
sshfs#
${
NEPTUN
}
@
${
SERVER
}
:home
\"
mountpoint=
\"
~
\/
sshfs
\"
options=
\"
nonempty,reconnect,StrictHostKeyChecking=no
\"
\/
>
\n\1
/"
/etc/security/pam_mount.conf.xml
sed
-i
"s/^
\(
<
\/
pam_mount>.*
\)
/<volume user=
\"
$USER
\"
fstype=
\"
fuse
\"
path=
\"
sshfs#
${
NEPTUN
}
@
${
SERVER
}
:home
\"
mountpoint=
\"
~
\/
sshfs
\"
options=
\"
nonempty,reconnect,StrictHostKeyChecking=no
\"
\/
>
\n\1
/"
/etc/security/pam_mount.conf.xml
miscellaneous/context/ubuntu/etc/context/init.d/03profile
View file @
18a17416
...
@@ -2,5 +2,7 @@
...
@@ -2,5 +2,7 @@
echo
"En vagyok a
$0
!"
echo
"En vagyok a
$0
!"
echo
"export NEPTUN=
$NEPTUN
"
>>
$HOME
/.profile
if
[
"
$RECONTEXT
"
!=
"YES"
]
;
then
echo
"export NEPTUN=
$NEPTUN
"
>>
$HOME
/.profile
fi
miscellaneous/context/ubuntu/etc/context/init.sh
View file @
18a17416
...
@@ -4,21 +4,26 @@ export BASEDIR=$(dirname $0)
...
@@ -4,21 +4,26 @@ export BASEDIR=$(dirname $0)
export
USER
=
"cloud"
export
USER
=
"cloud"
export
HOME
=
$(
awk
-F
:
-v
u
=
$USER
'$1==u{print $6}'
/etc/passwd
)
export
HOME
=
$(
awk
-F
:
-v
u
=
$USER
'$1==u{print $6}'
/etc/passwd
)
mkdir
-p
"
$BASEDIR
/mnt"
cd
"
$BASEDIR
"
cd
"
$BASEDIR
"
mount
-t
iso9660 /dev/cdrom1
"
$BASEDIR
/mnt"
2> /dev/null
mount
-t
iso9660 /dev/cdrom1
"
$BASEDIR
/mnt"
2> /dev/null
if
[
$?
-eq
0
-a
-f
"
$BASEDIR
/firstrun"
-a
-f
"
$BASEDIR
/mnt/context.sh"
]
;
then
if
[
$?
-eq
0
-a
-f
"
$BASEDIR
/firstrun"
-a
-f
"
$BASEDIR
/mnt/context.sh"
]
;
then
.
"
$BASEDIR
/mnt/context.sh"
.
"
$BASEDIR
/mnt/context.sh"
# hogy tudom kiexportalni ennel szebben ezeket a valtozokat?
if
[
"
$RECONTEXT
"
!=
"YES"
]
;
then
eval
`
grep
-o
'^[a-zA-Z0-9]\+='
"
$BASEDIR
/mnt/context.sh"
|
while
read
x
;
do
echo export
${
x
%=
}
;
done
`
rm
"
$BASEDIR
/firstrun"
else
touch /run/context-cleanup
fi
run-parts
"
$BASEDIR
/init.d"
for
i
in
$BASEDIR
/init.d/
*
;
do
source
$i
done
rm
"
$BASEDIR
/firstrun"
else
else
echo
"mar korabban lefutott!"
echo
"mar korabban lefutott!"
fi
fi
umount /dev/cdrom1 2>/dev/null
umount /dev/cdrom1 2>/dev/null
...
...
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