PHP 8.5.2
Preview: Z99-cloudinit-warnings.sh Size: 841 B
/etc/profile.d/Z99-cloudinit-warnings.sh

#!/bin/sh
# This file is part of cloud-init. See LICENSE file for license information.

# Purpose: show user warnings on login.

cloud_init_warnings() {
    command -v local >/dev/null && local _local="local" ||
        typeset _local="typeset"
    $_local warning="" idir="/var/lib/cloud/instance" n=0
    $_local warndir="$idir/warnings"
    $_local ufile="$HOME/.cloud-warnings.skip" sfile="$warndir/.skip"
    [ -d "$warndir" ] || return 0
    [ ! -f "$ufile" ] || return 0
    [ ! -f "$sfile" ] || return 0

    for warning in "$warndir"/*; do
        [ -f "$warning" ] || continue
        cat "$warning"
        n=$((n+1))
    done
    [ $n -eq 0 ] && return 0
    echo ""
    echo "Disable the warnings above by:"
    echo "  touch $ufile"
    echo "or"
    echo "  touch $sfile"
}

cloud_init_warnings 1>&2
unset cloud_init_warnings

Directory Contents

Dirs: 0 × Files: 8

Name Size Perms Modified Actions
96 B lrw-r--r-- 2024-04-22 13:04:27
Edit Download
840 B lrw-r--r-- 2025-11-21 07:08:02
Edit Download
726 B lrw-r--r-- 2023-09-18 00:38:13
Edit Download
1.08 KB lrw-r--r-- 2024-03-31 05:33:52
Edit Download
757 B lrw-r--r-- 2024-03-31 05:33:52
Edit Download
1.52 KB lrw-r--r-- 2024-02-10 17:03:36
Edit Download
3.32 KB lrwxr-xr-x 2025-08-12 21:19:32
Edit Download
841 B lrwxr-xr-x 2025-08-12 21:19:32
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).