Skip to content

Commit 9e87b74

Browse files
xboardCopilot
andcommitted
fix: xbctl not found after install
- Symlink /usr/local/bin/xbctl → /usr/bin/xbctl for distros where /usr/local/bin is not in PATH - Show CLI path in install success message - Remove symlink on uninstall Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 680795c commit 9e87b74

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ install_staged_files() {
655655
install -m 755 "$0" "$INSTALLER_COPY_PATH"
656656
fi
657657
install -m 755 "$TMP_DIR/xbctl" "$CLI_PATH"
658+
ln -sf "$CLI_PATH" /usr/bin/xbctl 2>/dev/null || true
658659
install -m 644 "$TMP_DIR/${SERVICE_NAME}" "$SERVICE_PATH"
659660
systemctl daemon-reload
660661
systemctl enable "$SERVICE_NAME" > /dev/null 2>&1
@@ -722,6 +723,7 @@ perform_install() {
722723
if [ "$HEALTH_ENABLED" -eq 1 ]; then
723724
log_info "Health: http://127.0.0.1:${HEALTH_PORT}/healthz"
724725
fi
726+
log_info "CLI: ${CLI_PATH} (run '${CLI_PATH} list' if xbctl is not in PATH)"
725727
}
726728

727729
perform_upgrade() {
@@ -739,6 +741,7 @@ perform_upgrade() {
739741
backup_existing_state
740742
install -m 755 "$TMP_DIR/xboard-node" "$BINARY_PATH"
741743
install -m 755 "$TMP_DIR/xbctl" "$CLI_PATH"
744+
ln -sf "$CLI_PATH" /usr/bin/xbctl 2>/dev/null || true
742745
install -m 644 "$TMP_DIR/${SERVICE_NAME}" "$SERVICE_PATH"
743746
systemctl daemon-reload
744747
systemctl restart "$SERVICE_NAME"
@@ -772,6 +775,7 @@ perform_uninstall() {
772775
fi
773776
rm -f "$BINARY_PATH"
774777
rm -f "$CLI_PATH"
778+
rm -f /usr/bin/xbctl 2>/dev/null || true
775779
if [ "$PURGE" -eq 1 ]; then
776780
rm -rf "$INSTALL_ROOT"
777781
log_info "Removed ${INSTALL_ROOT}"

0 commit comments

Comments
 (0)