-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupAService.sh
executable file
·40 lines (29 loc) · 979 Bytes
/
setupAService.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
#!/bin/bash
#pip3 install -r requirements.txt
# Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=$(dirname "$SCRIPT")
echo $SCRIPTPATH
sudo rm -f /lib/systemd/system/rhasspy.skill.timer.service
touch /lib/systemd/system/rhasspy.skill.timer.service
:> /lib/systemd/system/rhasspy.skill.timer.service
echo "
[Unit]
Description=Rhasspy timer Skill
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 $SCRIPTPATH/action-timer.py
WorkingDirectory=$SCRIPTPATH
Restart=on-abort
[Install]
WantedBy=multi-user.target
" >> /lib/systemd/system/rhasspy.skill.timer.service
chmod +x action-timer.py
sudo sudo chmod 644 /lib/systemd/system/rhasspy.skill.timer.service
sudo systemctl stop rhasspy.skill.timer.service
sudo systemctl daemon-reload
sudo systemctl enable rhasspy.skill.timer.service
sudo systemctl start rhasspy.skill.timer.service
#sudo reboot