mirror of
https://github.com/marcan/takeover.sh
synced 2025-08-20 13:23:54 -07: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
1 changed files with 2 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue