-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathinstall-systemd-services.sh
executable file
·49 lines (40 loc) · 1.04 KB
/
install-systemd-services.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
43
44
45
46
47
48
49
#!/bin/bash
set -e
cd "$(dirname "$0")"
if ! systemctl --user status sba-md.service; then
cat > sba-md.service <<EOF
[Unit]
Description=Transform Markdown files, pdf and Youtube transcripts into text files
DefaultDependencies=no
After=network.target
[Service]
Type=simple
ExecStart=$PWD/sba-md-service.sh
TimeoutStartSec=0
RemainAfterExit=yes
[Install]
WantedBy=default.target
EOF
systemctl --user enable "$PWD/sba-md.service"
systemctl --user start sba-md.service
systemctl --user status sba-md.service
fi
if ! systemctl --user status sba-txt.service; then
cat > sba-txt.service <<EOF
[Unit]
Description=Transform txt files into chunks and then into embeddings in a vector db
DefaultDependencies=no
After=network.target
[Service]
Type=simple
ExecStart=$PWD/sba-txt-service.sh
TimeoutStartSec=0
RemainAfterExit=yes
[Install]
WantedBy=default.target
EOF
systemctl --user enable $PWD/sba-txt.service
systemctl --user start sba-txt.service
systemctl --user status sba-txt.service
fi
# install-systetxt-services.sh ends here