#!/usr/bin/env bash set -euo pipefail # Installs a systemd *user* service to run Cisco VPN auto-connect in the logged-in GUI session. # Intended to be executed inside the VM as the desktop user (not root). # # Usage: # ./install-cisco-vpn-user-service.sh SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" UNIT_SRC="$SCRIPT_DIR/cisco-vpn-connect.service.user" UNIT_NAME="cisco-vpn-connect.service" if [[ ! -f "$UNIT_SRC" ]]; then echo "Missing $UNIT_SRC" >&2 exit 1 fi mkdir -p "$HOME/.config/systemd/user" install -m 0644 "$UNIT_SRC" "$HOME/.config/systemd/user/$UNIT_NAME" systemctl --user daemon-reload systemctl --user enable --now "$UNIT_NAME" systemctl --user --no-pager --full status "$UNIT_NAME" || true