You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
577 B
23 lines
577 B
![]()
6 years ago
|
#!/bin/sh
|
||
|
exec >/dev/console 2>&1
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
export TERM=linux
|
||
|
export PS1='initramfs-test:\w\$ '
|
||
|
stty sane
|
||
|
echo "made it to the rootfs! Powering down."
|
||
|
|
||
|
(
|
||
|
echo OK
|
||
|
ip -o -4 address show scope global | while read n if rest; do echo $if;done | sort
|
||
|
for i in /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-*; do
|
||
|
echo $i
|
||
|
grep -v 'UUID=' $i
|
||
|
done
|
||
|
echo EOF
|
||
|
) > /dev/sda
|
||
|
|
||
|
strstr "$CMDLINE" "rd.shell" && sh -i
|
||
|
poweroff -f
|