Files
local_machine/docs/apps/joplin/scripts/joplin-hotspot-alias-install.sh
ahauimix 0238aa7c02 Add Object B and self-growth canons with Cursor ledger rules; refresh connectivity and VPN runbooks.
Track day metrics/anamnesis HARD rules under .cursor/rules and personal docs so each screening updates days/{KIN}, dynamics, and big-data ledger.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 10:22:56 +08:00

46 lines
1.5 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# LaunchAgent: каждые 60 с проверять primary *.100 (нужен joplin-hotspot-alias-install-sudo.sh).
set -e
ROOT="$(CDPATH= cd -- "$(dirname "$0")" && pwd)"
ALIAS="$ROOT/joplin-hotspot-alias.sh"
PLIST="$HOME/Library/LaunchAgents/com.eternal.joplin-hotspot-alias.plist"
chmod +x "$ROOT"/joplin-hotspot-alias*.sh
mkdir -p "$HOME/Library/LaunchAgents" "$HOME/Library/Logs/joplin-webdav"
cat >"$PLIST" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.eternal.joplin-hotspot-alias</string>
<key>ProgramArguments</key>
<array>
<string>$ALIAS</string>
<string>ensure</string>
</array>
<key>StartInterval</key>
<integer>60</integer>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>$HOME/Library/Logs/joplin-webdav/alias-launchd.out.log</string>
<key>StandardErrorPath</key>
<string>$HOME/Library/Logs/joplin-webdav/alias-launchd.err.log</string>
</dict>
</plist>
EOF
launchctl bootout "gui/$(id -u)/com.eternal.joplin-hotspot-alias" 2>/dev/null || true
launchctl bootstrap "gui/$(id -u)" "$PLIST"
launchctl enable "gui/$(id -u)/com.eternal.joplin-hotspot-alias" 2>/dev/null || true
echo "LaunchAgent com.eternal.joplin-hotspot-alias установлен (каждые 60 с)."
echo "Для работы без пароля один раз:"
echo " $ROOT/joplin-hotspot-alias-install-sudo.sh"
echo "Сейчас:"
"$ALIAS" status