#!/bin/bash
# $1=indi_lx200zeq25
if [ $# == 0 ];then
echo "no argument"
exit 1
fi
echo "driver:$1"
server_running=$(ps -ef|grep -v grep|grep indiserver|grep "$1"|awk '{print $2}')
if [ ! -z "$server_running" ];then
echo "server is already running"
exit 0
fi
killall -9 indiserver
indiserver $1 > /dev/null 2>&1 &
cnt=0
while [ $cnt -lt 50 ]
do
#netstat -lp会很慢
indi_running=$(ss -tlp|grep -v zwoair_guider|grep -w indiserver|awk '{print $1}')
if [ ! -z "$indi_running" ];then
echo "indi is running"
break
fi
sleep 0.05
cnt=$[$cnt+1]
done
: '
guider里起indi时
ss -tlp
LISTEN 0 5 0.0.0.0:7624 0.0.0.0:* users:(("indiserver",pid=31588,fd=4))
LISTEN 0 5 0.0.0.0:4040 0.0.0.0:* users:(("indiserver",pid=31588,fd=13),("zwoair_guider",pid=13413,fd=13))
LISTEN 0 5 0.0.0.0:4400 0.0.0.0:* users:(("indiserver",pid=31588,fd=17),("zwoair_guider",pid=13413,fd=17))
LISTEN 0 5 0.0.0.0:4500 0.0.0.0:* users:(("indiserver",pid=31588,fd=16),("zwoair_guider",pid=13413,fd=16))
LISTEN 0 5 0.0.0.0:4030 0.0.0.0:* users:(("indiserver",pid=31588,fd=15),("zwoair_guider",pid=13413,fd=15))
'
This "Start_indi.sh" script will kill every Indi process if the daemon is running. It would take a good deep research on how to work with Indies, because third party mounts are definitely used by Indies. EAF and the camera are controlled via binaries, since there is little chance of getting onto these devices. The USB operator deserves a detailed investigation. I think there is a chance to break through.