HEX
Server: Apache
System: Linux vps35971 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
User: haitiopendh (6209306)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: //etc/runit/3
#!/bin/sh
exec 2>&1

PATH=/sbin:/usr/sbin:/bin:/usr/bin

LAST=0

# While test -x is more natural, it does not consider file with
# executable bit set on 'noexec' filesystem as executable, and /run
# often is mounted as 'noexec'.
[ $(stat -c %a /run/runit.reboot) = 100 ] && LAST=6
# used by /sbin/runlevel
touch "/run/runit.runlevel.$LAST"

echo 'Waiting for services to stop...'
sv force-stop /etc/service/*
sv exit /etc/service/*

echo 'Running shutdown tasks...'
/lib/runit/run_sysv_scripts "/etc/rc$LAST.d" stop