Fix Unicode character issues in apt-layer.sh

This commit is contained in:
robojerk 2025-07-12 12:50:31 -07:00
parent ed8f2bc68b
commit 32a427ace4

View file

@ -458,14 +458,14 @@ get_system_info() {
echo "Architecture: $(uname -m)"
echo "Available modules:"
if modprobe -n squashfs >/dev/null 2>&1; then
echo " squashfs module available"
echo " â squashfs module available"
else
echo " squashfs module not available"
echo " â squashfs module not available"
fi
if modprobe -n overlay >/dev/null 2>&1; then
echo " overlay module available"
echo " â overlay module available"
else
echo " overlay module not available"
echo " â overlay module not available"
fi
}
@ -1703,7 +1703,7 @@ container_status() {
# OCI Export/Import Integration
# ============================================================================
# OCI Integration for Ubuntu uBlue apt-layer Tool
# Provides ComposeFS OCI export/import functionality for container-based layer creation
# Provides ComposeFS â OCI export/import functionality for container-based layer creation
# OCI registry configuration
declare -A OCI_REGISTRY_CONFIG
@ -2243,9 +2243,9 @@ oci_status() {
echo "=== OCI Tool Configuration ==="
echo "Preferred tool: $OCI_TOOL"
echo "Available tools:"
command -v skopeo &> /dev/null && echo " skopeo"
command -v podman &> /dev/null && echo " podman"
command -v docker &> /dev/null && echo " docker"
command -v skopeo &> /dev/null && echo " â skopeo"
command -v podman &> /dev/null && echo " â podman"
command -v docker &> /dev/null && echo " â docker"
echo ""
echo "=== OCI Workspace ==="
@ -2565,7 +2565,7 @@ atomic_status() {
fi
if [[ -n "$pending_deployment" ]]; then
echo "⚠️ Pending deployment will activate on next boot"
echo "â ï¸ Pending deployment will activate on next boot"
fi
}
@ -3249,7 +3249,7 @@ get_live_overlay_status() {
echo "=== Live Overlay Status ==="
if is_live_overlay_active; then
log_success " Live overlay is ACTIVE" "apt-layer"
log_success "â Live overlay is ACTIVE" "apt-layer"
# Show mount details
if mountpoint -q "$LIVE_OVERLAY_MOUNT_POINT"; then
@ -3267,22 +3267,22 @@ get_live_overlay_status() {
log_info "Packages installed in overlay: $package_count" "apt-layer"
fi
else
log_warning "⚠️ Overlay mount point not mounted" "apt-layer"
log_warning "â ï¸ Overlay mount point not mounted" "apt-layer"
fi
# Check for active processes
if check_active_processes; then
log_warning "⚠️ Active processes detected - overlay cannot be stopped" "apt-layer"
log_warning "â ï¸ Active processes detected - overlay cannot be stopped" "apt-layer"
fi
else
log_info " Live overlay is not active" "apt-layer"
log_info "â¹ Live overlay is not active" "apt-layer"
# Check if system supports live overlay
if check_live_overlay_support >/dev/null 2>&1; then
log_info " System supports live overlay" "apt-layer"
log_info "â¹ System supports live overlay" "apt-layer"
log_info "Use '--live-overlay start' to start live overlay" "apt-layer"
else
log_warning "⚠️ System does not support live overlay" "apt-layer"
log_warning "â ï¸ System does not support live overlay" "apt-layer"
fi
fi
@ -5411,9 +5411,9 @@ get_advanced_package_info() {
echo ""
echo "Security Information:"
if check_package_signature "$package"; then
echo " Package is signed"
echo " â Package is signed"
else
echo " Package is not signed"
echo " â Package is not signed"
fi
# Size information
@ -6168,11 +6168,11 @@ get_layer_signing_status() {
# Check if layer exists
if [[ ! -f "$layer_path" ]]; then
echo " Layer file not found"
echo " â Layer file not found"
return 1
fi
echo " Layer file exists"
echo " â Layer file exists"
# Check for signatures
local signature_db="$LAYER_SIGNING_SIGNATURES_DIR/signatures.json"
@ -6190,21 +6190,21 @@ get_layer_signing_status() {
local signed_at
signed_at=$(echo "$signature_info" | jq -r '.signed_at // "unknown"')
echo " Signed with $method using key: $key_name"
echo " Signature status: $status"
echo " Signed at: $signed_at"
echo " â Signed with $method using key: $key_name"
echo " â Signature status: $status"
echo " â Signed at: $signed_at"
else
echo " No signature found"
echo " â No signature found"
fi
else
echo " Signature database not found"
echo " â Signature database not found"
fi
# Check for revocation
if check_layer_revocation "$layer_path"; then
echo " Layer is revoked"
echo " â  Layer is revoked"
else
echo " Layer is not revoked"
echo " â Layer is not revoked"
fi
echo ""
@ -8029,10 +8029,10 @@ YELLOW='\033[1;33m'
RED='\033[0;31m'
CYAN='\033[0;36m'
NC='\033[0m'
CHECK=""
WARN="⚠️ "
CROSS=""
INFO=" "
CHECK="â"
WARN="â ï¸ "
CROSS="â"
INFO="â¹ï¸ "
# --- Helper: Check for WSL ---
is_wsl() {
@ -8853,16 +8853,16 @@ check_tenant_health() {
# Check tenant exists
if [[ ! -d "$tenant_dir" ]]; then
echo " Tenant directory not found"
echo "â Tenant directory not found"
return 1
fi
if ! jq -e ".tenants[] | select(.name == \"$tenant_name\")" "$tenant_db" > /dev/null 2>&1; then
echo " Tenant not found in database"
echo "â Tenant not found in database"
return 1
fi
echo " Tenant exists"
echo "â Tenant exists"
# Check directory structure
local missing_dirs=()
@ -8873,9 +8873,9 @@ check_tenant_health() {
done
if [[ ${#missing_dirs[@]} -gt 0 ]]; then
echo "⚠️ Missing directories: ${missing_dirs[*]}"
echo "â ï¸ Missing directories: ${missing_dirs[*]}"
else
echo " Directory structure complete"
echo "â Directory structure complete"
fi
# Check quota usage
@ -8888,7 +8888,7 @@ check_tenant_health() {
storage_used=$(echo "$tenant_info" | jq -r '.quotas.used_storage_gb')
storage_max=$(echo "$tenant_info" | jq -r '.quotas.max_storage_gb')
echo "📊 Resource Usage:"
echo "ð Resource Usage:"
echo " Layers: $layers_used/$layers_max"
echo " Storage: ${storage_used}GB/${storage_max}GB"
@ -8897,14 +8897,14 @@ check_tenant_health() {
local storage_percent=$((storage_used * 100 / storage_max))
if [[ $layer_percent -gt 80 ]]; then
echo "⚠️ Layer quota usage high: ${layer_percent}%"
echo "â ï¸ Layer quota usage high: ${layer_percent}%"
fi
if [[ $storage_percent -gt 80 ]]; then
echo "⚠️ Storage quota usage high: ${storage_percent}%"
echo "â ï¸ Storage quota usage high: ${storage_percent}%"
fi
echo " Tenant health check complete"
echo "â Tenant health check complete"
}
# Multi-tenant command handler
@ -15244,25 +15244,25 @@ cloud_security_status() {
# Check if system is initialized
if [[ -d "$cloud_security_dir" ]]; then
echo " System initialized: $cloud_security_dir"
echo "â System initialized: $cloud_security_dir"
# Check configuration
local config_file="$cloud_security_dir/cloud-security-config.json"
if [[ -f "$config_file" ]]; then
echo " Configuration: $config_file"
echo "â Configuration: $config_file"
local enabled_providers=$(jq -r '.enabled_providers[]' "$config_file" 2>/dev/null | tr '\n' ', ' | sed 's/,$//')
echo " Enabled providers: $enabled_providers"
else
echo " Configuration missing"
echo "â Configuration missing"
fi
# Check directories
local dirs=("scans" "policies" "reports" "integrations")
for dir in "${dirs[@]}"; do
if [[ -d "$cloud_security_dir/$dir" ]]; then
echo " $dir directory: $cloud_security_dir/$dir"
echo "â $dir directory: $cloud_security_dir/$dir"
else
echo " $dir directory missing"
echo "â $dir directory missing"
fi
done
@ -15271,13 +15271,13 @@ cloud_security_status() {
local policy_count=$(find "$cloud_security_dir/policies" -name "*.json" 2>/dev/null | wc -l)
local report_count=$(find "$cloud_security_dir/reports" -name "*.json" 2>/dev/null | wc -l)
echo "📊 Statistics:"
echo "ð Statistics:"
echo " Security scans: $scan_count"
echo " Policy files: $policy_count"
echo " Compliance reports: $report_count"
else
echo " System not initialized"
echo "â System not initialized"
echo " Run 'cloud-security init' to initialize"
fi
}