mirror of
https://github.com/marcan/takeover.sh
synced 2025-08-19 21:03:50 -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
|
||||
|
||||
TO=/takeover
|
||||
OLD_TELINIT=/sbin/telinit
|
||||
PORT=80
|
||||
|
||||
cd "$TO"
|
||||
|
@ -47,7 +46,6 @@ if [ "$a" != "OK" ] ; then
|
|||
fi
|
||||
|
||||
./busybox echo "Preparing init..."
|
||||
./busybox cp $OLD_TELINIT tmp/telinit
|
||||
./busybox cat >tmp/init <<EOF
|
||||
#!${TO}/busybox sh
|
||||
|
||||
|
@ -80,9 +78,9 @@ fi
|
|||
./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 mount --bind tmp /sbin
|
||||
./busybox mount --bind tmp/init /sbin/init
|
||||
|
||||
./tmp/telinit u
|
||||
telinit u
|
||||
|
||||
./busybox sleep 10
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue