mirror of
https://github.com/marcan/takeover.sh.git
synced 2020-11-18 19:38:40 -08:00
Bind mount just the init file
This is cleaner and saves you from having to copy telinit beforehand.
This commit is contained in:
parent
f77041a12a
commit
b69d42fb27
@ -2,7 +2,6 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
TO=/takeover
|
TO=/takeover
|
||||||
OLD_TELINIT=/sbin/telinit
|
|
||||||
PORT=80
|
PORT=80
|
||||||
|
|
||||||
cd "$TO"
|
cd "$TO"
|
||||||
@ -47,7 +46,6 @@ if [ "$a" != "OK" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
./busybox echo "Preparing init..."
|
./busybox echo "Preparing init..."
|
||||||
./busybox cp $OLD_TELINIT tmp/telinit
|
|
||||||
./busybox cat >tmp/init <<EOF
|
./busybox cat >tmp/init <<EOF
|
||||||
#!${TO}/busybox sh
|
#!${TO}/busybox sh
|
||||||
|
|
||||||
@ -80,9 +78,9 @@ fi
|
|||||||
./busybox echo "You may then kill the remnants of this session and any remaining"
|
./busybox echo "You may then kill the remnants of this session and any remaining"
|
||||||
./busybox echo "processes from your new SSH session, and umount the old root filesystem."
|
./busybox echo "processes from your new SSH session, and umount the old root filesystem."
|
||||||
|
|
||||||
./busybox mount --bind tmp /sbin
|
./busybox mount --bind tmp/init /sbin/init
|
||||||
|
|
||||||
./tmp/telinit u
|
telinit u
|
||||||
|
|
||||||
./busybox sleep 10
|
./busybox sleep 10
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user