# Create target icon asset directories
echo "== Updating Icon Pack for NEMS Central Command =="
mkdir -p /home/admin/debpack/nems-www/debpack/var/www/html/assets/icons/{lucide,tabler,simple}
cd /tmp

echo "===> Downloading Tabler Icons (Hardware & Infrastructure)..."
curl -sL https://github.com/tabler/tabler-icons/releases/download/v3.21.0/tabler-icons-3.21.0.zip -o tabler.zip
unzip -q tabler.zip -d tabler_temp
cp -R tabler_temp/svg/* /home/admin/debpack/nems-www/debpack/var/www/html/assets/icons/tabler/
rm -rf tabler.zip tabler_temp

echo "===> Downloading Simple Icons (OS, Vendor, & Brand Logos)..."
curl -sL https://github.com/simple-icons/simple-icons/archive/refs/heads/master.tar.gz | tar -xz
cp simple-icons-master/icons/*.svg /home/admin/debpack/nems-www/debpack/var/www/html/assets/icons/simple/
rm -rf simple-icons-master

echo "===> Downloading Lucide Icons (General UI & Categories)..."
curl -sL https://github.com/lucide-icons/lucide/archive/refs/heads/main.tar.gz | tar -xz
cp lucide-main/icons/*.svg /home/admin/debpack/nems-www/debpack/var/www/html/assets/icons/lucide/
rm -rf lucide-main

echo "===> Setting Web Permissions..."
#chown -R www-data:www-data /home/admin/debpack/nems-www/debpack/var/www/html/assets/icons
chmod -R 755 /home/admin/debpack/nems-www/debpack/var/www/html/assets/icons

echo "Done! Icons installed at /home/admin/debpack/nems-www/debpack/var/www/html/assets/icons/"
echo "========="

