1
0
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:
James Le Cuirot 2017-02-22 13:46:28 +00:00
parent f77041a12a
commit b69d42fb27
No known key found for this signature in database
GPG Key ID: 21C632129C6D7DE4

View File

@ -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