Mercurial > infra > box / airootfs/root/.automated_script.sh
changeset 2: |
2fafbe22bd34 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 31 May 2024 17:30:09 -0400 |
permissions: |
-rwxr-xr-x |
description: |
init releng |
5 for param
in $(</proc/cmdline
); do 17 script="$(script_cmdline
)" 18 if [[ -n
"${script}" && !
-x
/tmp/startup_script
]]; then 19 if [[ "${script}" =~
^
((http
|https
|ftp
|tftp
)://
) ]]; then 20 # there's no synchronization for network availability before executing this script 21 printf '%s: waiting for network-online.target\n' "$0" 22 until systemctl
--quiet
is-active
network-online.target
; do 25 printf '%s: downloading %s\n' "$0" "${script}" 26 curl
"${script}" --location
--retry-connrefused
--retry
10 -s
-o
/tmp/startup_script
29 cp
"${script}" /tmp/startup_script
32 if [[ ${rt} -eq
0 ]]; then 33 chmod
+x
/tmp/startup_script
34 printf '%s: executing automated script\n' "$0" 35 # note that script is executed when other services (like pacman-init) may be still in progress, please 36 # synchronize to "systemctl is-system-running --wait" when your script depends on other services 42 if [[ $(tty
) == "/dev/tty1" ]]; then