Simple tmux-launcher.sh
for a script or command that can check to see if the session name exists yet or not before launching.
Put somewhere, like $HOME/.local/bin
Use it like this:
crontab -e
@reboot $HOME/.local/bin keyword scriptname
or a command and arguments like:
@reboot $HOME/.local/bin keyword -- command -with -options and arguments here
Like so:
@reboot $HOME/.local/bin funkybot $HOME/funky/bot.sh
cd ~/.local/bin
wget https://gist.githubusercontent.com/dayne/1bc3d0ead1044e4094f8fd8951cc2c34/raw/tmux-launcher.sh
chmod +x tmux-launcher.sh
After configuring ngrok to use a .ngrok2/ngrok.yml
file you will want it to launch on reboot and may still want be able to check in on the ngrok process & manage it from console.
Then you can use it like
@reboot $HOME/.local/bin/tmux-launcher.sh ngrok -- $HOME/.local/bin/ngrok start --all
Or if you want a script approach create a new file: $HOME/.local/bin/onboot-ngrok.sh
#!/bin/bash -l
ngrok start --all
chmod +x onboot-ngrok.sh
test it
./onboot-ngrok.sh
If it works then use the tmux-launcher.sh tool:
crontab -e
@reboot $HOME/.local/bin/tmux-launcher.sh ngrok $HOME/.local/bin/onboot-ngrok.sh