Remove automatic user switch, show clear instructions instead
Instead of trying to automatically switch users (which doesn't work reliably), display clear instructions to the user: 'CHANGE USER NOW with: sudo -i -u clawdbot' This is simpler, more reliable, and gives the user control. Updates: - run-playbook.sh: Show instructions instead of exec - install.sh: Update comment - README.md: Clarify post-install steps
This commit is contained in:
parent
3630b2855e
commit
3ef645c5b5
23
README.md
23
README.md
@ -33,15 +33,26 @@ curl -fsSL https://raw.githubusercontent.com/pasogott/clawdbot-ansible/main/inst
|
||||
|
||||
## Post-Install
|
||||
|
||||
After installation completes, switch to the clawdbot user:
|
||||
|
||||
```bash
|
||||
# 1. Connect to Tailscale
|
||||
sudo tailscale up
|
||||
sudo -i -u clawdbot
|
||||
```
|
||||
|
||||
# 2. Configure Clawdbot
|
||||
sudo nano /home/clawdbot/.clawdbot/config.yml
|
||||
This will show you the next steps for:
|
||||
- Configuring Clawdbot
|
||||
- Logging into your messaging provider (WhatsApp/Telegram/Signal)
|
||||
- Testing the gateway
|
||||
- Connecting Tailscale
|
||||
|
||||
# 3. Login as clawdbot user
|
||||
sudo su - clawdbot
|
||||
You can also manage the service:
|
||||
|
||||
```bash
|
||||
# Check status
|
||||
sudo systemctl status clawdbot
|
||||
|
||||
# View logs
|
||||
sudo journalctl -u clawdbot -f
|
||||
clawdbot login
|
||||
|
||||
# 4. Check status
|
||||
|
||||
@ -90,5 +90,4 @@ echo ""
|
||||
cd /
|
||||
rm -rf "$TEMP_DIR"
|
||||
|
||||
# The run-playbook.sh script will automatically launch /tmp/clawdbot-setup.sh
|
||||
# which handles the user switch and displays setup instructions
|
||||
# run-playbook.sh will display instructions to switch to clawdbot user
|
||||
|
||||
@ -97,6 +97,6 @@
|
||||
line: '[ -f ~/.clawdbot-welcome ] && source ~/.clawdbot-welcome'
|
||||
state: present
|
||||
|
||||
- name: Signal playbook completion
|
||||
ansible.builtin.set_fact:
|
||||
clawdbot_setup_ready: true
|
||||
- name: Notify that playbook is complete
|
||||
ansible.builtin.debug:
|
||||
msg: "✅ Clawdbot installation complete!"
|
||||
|
||||
@ -10,16 +10,22 @@ else
|
||||
PLAYBOOK_EXIT=$?
|
||||
fi
|
||||
|
||||
# After playbook completes successfully, switch to clawdbot user
|
||||
# After playbook completes successfully, show instructions
|
||||
if [ $PLAYBOOK_EXIT -eq 0 ]; then
|
||||
echo ""
|
||||
echo "🚀 Switching to clawdbot user..."
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "✅ INSTALLATION COMPLETE!"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "🔄 CHANGE USER NOW with:"
|
||||
echo ""
|
||||
echo " sudo -i -u clawdbot"
|
||||
echo ""
|
||||
echo "This will switch you to the clawdbot user and show"
|
||||
echo "the next setup steps (configuration, provider login, etc.)"
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
sleep 1
|
||||
|
||||
# The trick: replace current shell completely with sudo's shell
|
||||
# Don't use exec alone - use it within a login command
|
||||
exec sudo -u clawdbot -i
|
||||
else
|
||||
echo "❌ Playbook failed with exit code $PLAYBOOK_EXIT"
|
||||
exit $PLAYBOOK_EXIT
|
||||
|
||||
Loading…
Reference in New Issue
Block a user