#!/bin/bash # Please note that this script expects `slskd-permission-monitor.sh` to be copied into `/usr/local/bin/` set -e SERVICE_NAME="slskd-permission-monitor" SERVICE_PATH="/etc/systemd/system/${SERVICE_NAME}.service" SCRIPT_PATH="/usr/local/bin/slskd-permission-monitor.sh" # Check if running as root if [ "$(id -u)" -ne 0 ]; then echo "This script must be run as root." >&2 exit 1 fi # Create the service file cat > "$SERVICE_PATH" <