aboutsummaryrefslogtreecommitdiff
blob: d34c932ff4f071c78a746f9c6806a894136ed87e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

. /etc/initrd.defaults
. /etc/initrd.scripts

GK_INIT_LOG_PREFIX=${0}
if [ -n "${SSH_CLIENT_IP}" ] && [ -n "${SSH_CLIENT_PORT}" ]
then
	GK_INIT_LOG_PREFIX="${0}[${SSH_CLIENT_IP}:${SSH_CLIENT_PORT}]"
fi

# We don't want to kill init script (PID 1),
# ourselves and parent process yet...
pids_to_keep="1 ${$} ${PPID}"

for pid in $(pgrep sh)
do
	if ! echo " ${pids_to_keep} " | grep -q " ${pid} "
	then
		kill -9 ${pid} &>/dev/null
	fi
done

good_msg "Resuming boot process ..."
[ -f "${GK_SSHD_LOCKFILE}" ] && run rm "${GK_SSHD_LOCKFILE}"
[ "${PPID}" != '1' ] && kill -9 ${PPID} &>/dev/null

exit 0