-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-systemd
More file actions
executable file
·43 lines (35 loc) · 890 Bytes
/
install-systemd
File metadata and controls
executable file
·43 lines (35 loc) · 890 Bytes
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
#!/usr/bin/env bash
# installs systemd units from dotfiles
check-active() {
local service=$1
let x=1
while ((x < 10)); do
if sudo systemctl is-active --quiet $service; then
echo "$service is active"
return 0
fi
echo "$service is not active yet..."
sleep 1
((x++))
done
echo "$service is failing"
exit 1
}
enable_service() {
local dest=/etc/systemd/system
local service=$1
sudo cp ~/.dotfiles/systemd/$service $dest
sudo systemctl enable $service
}
restart_service() {
local service=$1
sudo systemctl restart $service
}
enable_service com.fightcpu.debug.service
enable_service com.fightcpu.ngrok-tidy.service
enable_service com.fightcpu.ngrok-tidy.timer
restart_service com.fightcpu.ngrok-tidy.timer
restart_service com.fightcpu.debug.service
sudo systemctl daemon-reload
check-active com.fightcpu.debug.service
check-active com.fightcpu.ngrok-tidy.timer