#!/bin/sh echo "Install environment..." . /etc/os-release ubuntu_version="$VERSION_ID" echo "Ubuntu version: $ubuntu_version" # Check if the version is 22.04 or later if [ "$ubuntu_version" \< "22.04" ]; then # Print an error message and exit echo "Error: Ubuntu version must be 22.04 or later" exit 1 fi # Install packages: sudo apt-get install -y binutils python3 python3-pip python3-opencv libcurl4-openssl-dev libssl-dev libpcsclite-dev # Install requirements: python3 -m pip install --upgrade pip && python3 -m pip install opencv-python gradio # Copy libraries to /usr/lib based on Ubuntu version if [ "$ubuntu_version" = "20.04" ]; then # Copy library for Ubuntu 20.04 sudo cp -f ./id_ocr/dependency/libimutils.so /usr/lib elif [ "$ubuntu_version" = "22.04" ]; then # Copy library for Ubuntu 22.04 sudo cp -f ./id_ocr/dependency/libimutils.so_for_ubuntu22 /usr/lib/libimutils.so else # Print an error message for unsupported Ubuntu versions echo "Error: Unsupported Ubuntu version" exit 1 fi sudo cp -f ./id_ocr/dependency/libttvcore.so /usr/lib sudo cp -rf ./id_live/dependency/* /usr/lib echo "Installed successfully!"