mirror of
https://github.com/marcan/takeover.sh
synced 2025-08-21 05:43:50 -07:00
Make shellcheck happy
+ identify the script :)
This commit is contained in:
parent
5782fc6188
commit
8279085811
1 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# https://github.com/marcan/takeover.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
TO=/takeover
|
TO=/takeover
|
||||||
|
@ -41,7 +44,7 @@ exec <"$TO/$TTY" >"$TO/$TTY" 2>"$TO/$TTY"
|
||||||
|
|
||||||
./busybox echo "Type 'OK' to continue"
|
./busybox echo "Type 'OK' to continue"
|
||||||
./busybox echo -n "> "
|
./busybox echo -n "> "
|
||||||
read a
|
read -r a
|
||||||
if [ "$a" != "OK" ] ; then
|
if [ "$a" != "OK" ] ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -58,6 +61,7 @@ cd "${TO}"
|
||||||
./busybox echo "Pivoting root..."
|
./busybox echo "Pivoting root..."
|
||||||
./busybox pivot_root . old_root
|
./busybox pivot_root . old_root
|
||||||
./busybox echo "Chrooting and running init..."
|
./busybox echo "Chrooting and running init..."
|
||||||
|
# shellcheck disable=SC2094
|
||||||
exec ./busybox chroot . /fakeinit
|
exec ./busybox chroot . /fakeinit
|
||||||
EOF
|
EOF
|
||||||
./busybox chmod +x tmp/init
|
./busybox chmod +x tmp/init
|
||||||
|
@ -70,7 +74,7 @@ EOF
|
||||||
./busybox echo "You should SSH into the secondary sshd now."
|
./busybox echo "You should SSH into the secondary sshd now."
|
||||||
./busybox echo "Type OK to continue"
|
./busybox echo "Type OK to continue"
|
||||||
./busybox echo -n "> "
|
./busybox echo -n "> "
|
||||||
read a
|
read -r a
|
||||||
if [ "$a" != "OK" ] ; then
|
if [ "$a" != "OK" ] ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -85,4 +89,3 @@ fi
|
||||||
./tmp/telinit u
|
./tmp/telinit u
|
||||||
|
|
||||||
./busybox sleep 10
|
./busybox sleep 10
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue