在cups的linux上安装 virtualhere ,客户端 windows 安装 usbcap ,实现扫描共能_编程_山海自留地

山海自留地

在cups的linux上安装 virtualhere ,客户端 windows 安装 usbcap ,实现扫描共能

编程
2025-06-26 11:04:43

在cups的linux上安装  virtualhere ,客户端 windows 安装 usbcap ,实现扫描共能 

#!/bin/sh
if [ "$(id -u)" -ne 0 ]; then
echo "Please run with sudo"
exit 1
fi
if [ -n "$1" ]; then
FILENAME="$1"
else
ARCH=$(uname -m)
if [ -z "${ARCH##arm}" ]; then
FILENAME="vhusbdarm"
elif [ "$ARCH" = "mips" ]; then
FILENAME="vhusbdmips"
elif [ "$ARCH" = "mipsel" ]; then
FILENAME="vhusbdmipsel"
elif [ -z "${ARCH##x86_64}" ]; then
FILENAME="vhusbdx86_64"
elif [ -z "${ARCH##aarch64}" ]; then
FILENAME="vhusbdarm64"
else
FILENAME="vhusbdi386"
fi
fi
wget https://www.virtualhere.com/sites/default/files/usbserver/$FILENAME
chmod +x $FILENAME
mv $FILENAME /usr/local/sbin
mkdir -p /usr/local/etc/virtualhere
if [ -d "/etc/systemd/system" ]; then
cat << EOF > /etc/systemd/system/virtualhere.service
[Unit]
Description=VirtualHere Server
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/sbin/$FILENAME -b -c /usr/local/etc/virtualhere/config.ini

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable virtualhere.service
systemctl start virtualhere.service
else
echo "Error, only systemd is supported"
fi