2a2b4d81d1
- Move autostart.sh from bin/ to features/ so re-installs never reset it - Add lib/flags.sh (flag_set/clear/is_set/value/list/status) + flag-reader/set/clear CLIs - install.sh --feature copies features/* to /usr/local/bin with overwrite prompt, sets flags - postinstall.sh enables autostart.service only when the autostart flag is set - Document features & flags in README, DEV.md, AGENT_Context_Project.md
22 lines
480 B
Bash
Executable File
22 lines
480 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
source "$(dirname "$0")/../lib/common.sh" 2>/dev/null || source "$(dirname "$0")/common.sh"
|
|
source "$(dirname "$0")/../lib/flags.sh" 2>/dev/null || source "$(dirname "$0")/flags.sh"
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Usage: flag-set <name> [value]
|
|
|
|
Set a feature flag (green), optionally storing a value.
|
|
Writes to $FLAGS_DIR (requires sudo).
|
|
EOF
|
|
exit 0
|
|
}
|
|
|
|
case "${1:-}" in
|
|
-h|--help|"") usage ;;
|
|
esac
|
|
|
|
flag_set "$1" "${2:-}"
|
|
ok "flag set: $1"
|