Files
shell/install/suld
T
2026-07-10 15:11:51 +08:00

49 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
##makedesc: Samsung Unified Linux Driver repo
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: Samsung Unified Linux Driver is not supported on macOS." >&2
exit 1
fi
echo
echo "==============================================="
echo "Installing Samsung Unified Linux Driver"
echo "==============================================="
echo
# https://www.bchemnet.com/suldr/
# https://www.bchemnet.com/suldr/supported.html
mkdir -p "$HOME/install"
sudo bash -c 'echo "deb https://www.bchemnet.com/suldr/ debian extra" >> /etc/apt/sources.list.d/samsung.list'
download \
https://www.bchemnet.com/suldr/pool/debian/extra/su/suldr-keyring_3_all.deb \
"$HOME/install/suldr-keyring_3_all.deb"
sudo dpkg -i "$HOME/install/suldr-keyring_3_all.deb"
sudo apt install -y suld-driver2-1.00.39
echo
echo "Finish!"
echo "Don't forget to connect your Samsung printer"
echo "See more info here: https://www.bchemnet.com/suldr/"
echo
}
case "$1" in
*) install ;;
esac