#!/usr/bin/env bash # Bithumb cron 등록 — 기존 crontab에 BITHUMB 블록 병합/갱신 set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" MARKER_BEGIN="# BITHUMB vol_breakout cron (begin)" MARKER_END="# BITHUMB vol_breakout cron (end)" EXAMPLE="${ROOT}/scripts/crontab.bithumb.example" usage() { cat </dev/null || true tmp="$(mktemp)" crontab -l 2>/dev/null | strip_block > "$tmp" || true render_block >> "$tmp" crontab "$tmp" rm -f "$tmp" echo "crontab installed. 확인: crontab -l" ;; --remove) tmp="$(mktemp)" if crontab -l 2>/dev/null | strip_block > "$tmp"; then crontab "$tmp" echo "BITHUMB cron block removed." else echo "crontab empty or not found." fi rm -f "$tmp" ;; -h|--help) usage ;; *) usage >&2 exit 1 ;; esac