Merge pull request #38 from outis1one/claude/integrate-talkkonnect-install-016rfpEaspgs7mfn2XHEVj7W
Claude/integrate talkkonnect install 016rfp easpgs7mfn2 xhe vj7 w
This commit is contained in:
+31
-16
@@ -69,7 +69,10 @@ check_talkkonnect_status() {
|
|||||||
local installed=false
|
local installed=false
|
||||||
local running=false
|
local running=false
|
||||||
|
|
||||||
if command -v talkkonnect &>/dev/null || [[ -f "$HOME/go/bin/talkkonnect" ]]; then
|
# Check if systemd service exists (most reliable indicator)
|
||||||
|
if [[ -f /etc/systemd/system/talkkonnect.service ]] || \
|
||||||
|
command -v talkkonnect &>/dev/null || \
|
||||||
|
[[ -f "/home/$KIOSK_USER/go/bin/talkkonnect" ]]; then
|
||||||
installed=true
|
installed=true
|
||||||
if systemctl is-active --quiet talkkonnect; then
|
if systemctl is-active --quiet talkkonnect; then
|
||||||
running=true
|
running=true
|
||||||
@@ -509,16 +512,14 @@ EOFOPUS
|
|||||||
cd cmd/talkkonnect || exit 1
|
cd cmd/talkkonnect || exit 1
|
||||||
|
|
||||||
echo 'Compiling with vendored dependencies...'
|
echo 'Compiling with vendored dependencies...'
|
||||||
go build -mod=vendor -v -o /home/$KIOSK_USER/talkkonnect-binary . 2>&1 | tail -20
|
go build -mod=vendor -v -o ~/talkkonnect-binary . 2>&1 | tail -20
|
||||||
|
|
||||||
if [[ -f /home/$KIOSK_USER/talkkonnect-binary ]]; then
|
if [[ ! -f ~/talkkonnect-binary ]]; then
|
||||||
chmod +x /home/$KIOSK_USER/talkkonnect-binary
|
|
||||||
echo 'Build successful'
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo 'Build failed - binary not created'
|
echo 'Build failed - binary not created'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo 'Build successful'
|
||||||
"
|
"
|
||||||
|
|
||||||
local build_result=$?
|
local build_result=$?
|
||||||
@@ -534,19 +535,33 @@ EOFOPUS
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify and install binary
|
# Stop any running talkkonnect before installing
|
||||||
if [[ ! -x "/home/$KIOSK_USER/talkkonnect-binary" ]]; then
|
echo "Installing binary..."
|
||||||
log_error "Binary not executable after build"
|
if systemctl is-active --quiet talkkonnect 2>/dev/null; then
|
||||||
|
echo "Stopping existing talkkonnect service..."
|
||||||
|
sudo systemctl stop talkkonnect
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kill any stray processes
|
||||||
|
if pgrep -x talkkonnect > /dev/null 2>&1; then
|
||||||
|
echo "Killing running talkkonnect processes..."
|
||||||
|
sudo pkill -9 talkkonnect
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Now install as kiosk user
|
||||||
|
sudo -u "$KIOSK_USER" bash -c "
|
||||||
|
cp ~/talkkonnect-binary ~/go/bin/talkkonnect
|
||||||
|
chmod +x ~/go/bin/talkkonnect
|
||||||
|
rm ~/talkkonnect-binary
|
||||||
|
"
|
||||||
|
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
log_error "Failed to install binary"
|
||||||
pause
|
pause
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing binary..."
|
|
||||||
sudo cp /home/$KIOSK_USER/talkkonnect-binary /home/$KIOSK_USER/go/bin/talkkonnect
|
|
||||||
sudo chmod +x /home/$KIOSK_USER/go/bin/talkkonnect
|
|
||||||
sudo chown "$KIOSK_USER:$KIOSK_USER" /home/$KIOSK_USER/go/bin/talkkonnect
|
|
||||||
rm -f /home/$KIOSK_USER/talkkonnect-binary
|
|
||||||
|
|
||||||
log_success "talkkonnect built successfully"
|
log_success "talkkonnect built successfully"
|
||||||
|
|
||||||
echo "[4/4] Creating configuration..."
|
echo "[4/4] Creating configuration..."
|
||||||
|
|||||||
Reference in New Issue
Block a user