31 lines
823 B
Bash
31 lines
823 B
Bash
|
|
TELEMETRY_FILE="$HOME/.runaway-telemetry"
|
|
|
|
telemetry_opt_in() {
|
|
local val="${1:-}"
|
|
if [ "$val" = "yes" ] || [ "$val" = "true" ] || [ "$val" = "1" ]; then
|
|
echo "enabled" > "$TELEMETRY_FILE"
|
|
success "Telemetry enabled"
|
|
elif [ "$val" = "no" ] || [ "$val" = "false" ] || [ "$val" = "0" ]; then
|
|
rm -f "$TELEMETRY_FILE"
|
|
success "Telemetry disabled"
|
|
else
|
|
local current="disabled"
|
|
[ -f "$TELEMETRY_FILE" ] && current="enabled"
|
|
info "Telemetry: $current"
|
|
info "Usage: sudo ./runaway telemetry on|off"
|
|
fi
|
|
}
|
|
|
|
telemetry_is_enabled() {
|
|
[ -f "$TELEMETRY_FILE" ] && return 0
|
|
return 1
|
|
}
|
|
|
|
telemetry_send() {
|
|
telemetry_is_enabled || return 0
|
|
# Upstream telemetry collector removed in this fork; nothing is sent.
|
|
# Kept as a no-op so opt-in state and call sites keep working.
|
|
return 0
|
|
}
|