-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
42 lines (36 loc) · 901 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
startServices(){
echo "$# Arguments passed"
for ((i=1;i<=$#;i++))
do
cd ~
nextService=${!i}
nextCmdIdx=$((i+1))
nextCommand=${!nextCmdIdx}
echo "Attempting to start service: $nextService using command $nextCommand"
startService $nextService $nextCommand
((i++))
done
}
startService(){
service=$1
command=$2
if ! screen -ls | grep -q $service;
then
echo "$service not running, starting $service..."
./$command
echo "started $service"
delay
else
echo "$service already running"
fi
}
delay(){
secs=1
while [ $secs -gt 0 ]; do
echo -ne "Waiting $secs\033[0K\r"
sleep 1
: $((secs--))
done
}
startServices diffusion diffusion.sh textgen textgen.sh stextras sillyextra.sh sillytavern silly.sh influx influx.sh telegraf telegraf.sh