-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBULK-Image-Utility
More file actions
69 lines (58 loc) · 2.99 KB
/
BULK-Image-Utility
File metadata and controls
69 lines (58 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# ─────────────────────────────────────────────
# install_bulk.sh — Installer for bulk image tool
# ─────────────────────────────────────────────
R='\033[0;31m' G='\033[0;32m' Y='\033[1;33m'
C='\033[0;36m' W='\033[1;37m'
DIM='\033[2m' BOLD='\033[1m' NC='\033[0m'
echo -e ""
echo -e "${C}${BOLD} ██████╗ ██╗ ██╗██╗ ██╗ ██╗"
echo -e " ██╔══██╗██║ ██║██║ ██║ ██╔╝"
echo -e " ██████╔╝██║ ██║██║ █████╔╝ "
echo -e " ██╔══██╗██║ ██║██║ ██╔═██╗ "
echo -e " ██████╔╝╚██████╔╝███████╗██║ ██╗"
echo -e " ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝${NC}"
echo -e " ${DIM} INSTALLER · bulk image tool${NC}"
echo -e ""
# ── Root check ────────────────────────────────
if [ "$EUID" -ne 0 ]; then
echo -e "${R}✗ Please run as root (sudo ./install_bulk.sh)${NC}"
exit 1
fi
# ── Dependencies ──────────────────────────────
echo -e "${W}> Installing dependencies…${NC}"
apt-get update -qq
PKGS=(imagemagick optipng curl bc)
for pkg in "${PKGS[@]}"; do
printf " %-20s" "$pkg"
if dpkg -s "$pkg" &>/dev/null; then
echo -e "${DIM}already installed${NC}"
else
if apt-get install -y -qq "$pkg" &>/dev/null; then
echo -e "${G}✓ installed${NC}"
else
echo -e "${R}✗ failed${NC}"
fi
fi
done
# ── Fetch script ──────────────────────────────
echo ""
echo -e "${W}> Fetching bulk from GitHub…${NC}"
URL="https://raw.githubusercontent.com/GlitchLinux/bulk/refs/heads/main/bulk"
DEST="/usr/local/bin/bulk"
if curl -fsSL "$URL" -o "$DEST"; then
echo -e " ${G}✓ Downloaded → ${DEST}${NC}"
else
echo -e " ${R}✗ Download failed. Check URL or network.${NC}"
exit 1
fi
# ── Permissions ───────────────────────────────
chmod +x "$DEST"
echo -e " ${G}✓ chmod +x ${DEST}${NC}"
# ── Done ──────────────────────────────────────
echo ""
echo -e " ┌─────────────────────────────────────┐"
printf " │ ${G}${BOLD}✓ Installation complete!${NC} │\n"
printf " │ Run with: ${BOLD}%-26s${NC}│\n" "bulk"
echo -e " └─────────────────────────────────────┘"
echo ""