links
apt install libusb-1.0-0-dev
apt install -y curl
curl -fsSL https://www.phidgets.com/downloads/setup_linux | bash -
apt install -y libphidget22 libphidget22extra phidget22networkserver phidget22admin phidget22wwwjs
apt install -y python3 npm nodejs net-tools openssh-server ssh
systemctl enable ssh
systemctl restart ssh
ifconfig
SERVICE_NAME="phidget22networkserver"
INIT_PATH="/etc/init.d/$SERVICE_NAME"
if [[ "$(id -u)" -ne 0 ]]; then
echo "Run this as root."
exit 1
fi
cat > "$INIT_PATH" <<'EOF'
#!/bin/sh
### BEGIN INIT INFO
# Provides: phidget22networkserver
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Should-Start: avahi avahi-daemon
# Should-Stop: avahi avahi-daemon
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Phidget Network Server
# Description: Phidget network server for accessing Phidgets over the network.
### END INIT INFO
sudo /usr/local/bin/phidget22networkserver -c /etc/phidgets/phidget22networkserver.pc -D
EOF
chmod +x "$INIT_PATH"
update-rc.d "$SERVICE_NAME" defaults
systemctl enable --now "$SERVICE_NAME"
service "$SERVICE_NAME" start
systemctl status phidget22networkserver --no-pager
root@recharjme-Ubuntu-Linux-1:/home/recharjme/Desktop# bash ./stack_scriptÂ
phidget22networkserver.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable phidget22networkserver
Job for phidget22networkserver.service failed because the control process exited with error code.
See "systemctl status phidget22networkserver.service" and "journalctl -xeu phidget22networkserver.service" for details.
root@recharjme-Ubuntu-Linux-1:/home/recharjme/Desktop# cd ./recharjme