Files
YaMusek/tools/auto-refresh.sh
T
Thorgathis acd50280bc Yandex Music client for Apple TV
tvOS 17+ SwiftUI client for the unofficial Yandex Music API: rotor stations
with feedback, library, search, artist and album pages, synced lyrics, and
system Now Playing integration.
2026-09-17 20:38:19 +03:00

38 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Re-sign and reinstall YaMusek so a free 7-day provisioning profile never
# expires in your face. Meant to be run by launchd once a day; see
# tools/install-autorefresh.sh.
#
# Config comes from tools/.autorefresh.env (written by install-autorefresh.sh):
# TEAM=XXXXXXXXXX
# BUNDLE=com.yamusek.tv
# DEVICE=<Apple TV name or UDID>
set -uo pipefail
cd "$(dirname "$0")/.."
LOG="${TMPDIR:-/tmp}/yamusek-autorefresh.log"
exec >>"$LOG" 2>&1
echo "=== $(date '+%Y-%m-%d %H:%M:%S') refresh start"
ENV_FILE="tools/.autorefresh.env"
if [[ ! -f "$ENV_FILE" ]]; then
echo "no $ENV_FILE - run tools/install-autorefresh.sh first"
exit 1
fi
# shellcheck disable=SC1090
source "$ENV_FILE"
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
# Nothing to do if the Apple TV is off or off-network; launchd will try again.
if ! xcrun devicectl list devices 2>/dev/null | grep -q -- "$DEVICE"; then
echo "device '$DEVICE' not reachable, skipping"
exit 0
fi
./tools/install.sh "$TEAM" "$BUNDLE" "$DEVICE"
status=$?
echo "=== refresh finished with status $status"
exit $status