-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·33 lines (28 loc) · 951 Bytes
/
setup.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
#!/bin/bash
# configs
mkdir -p "$HOME/domain-detective"
touch "$HOME/domain-detective/domain_list.txt" "$HOME/domain-detective/available_domains.txt"
echo -e "test.ir\nexample.com\ndomain.org" >"$HOME/domain-detective/domain_list.txt"
cp script.sh "$HOME/domain-detective/script.sh"
(
crontab -l
echo "0 * * * * $HOME/domain-detective/script.sh"
) | crontab -
# crontab
echo '
while IFS= read -r domain; do
echo "domain $domain is available!"
done < "$HOME/domain-detective/available_domains.txt"' >>~/.bashrc
# systemd
# touch /etc/systemd/system/domain-detective.service
# echo "[Unit]
# Description=My Domain Detective Service
# After=network.target
# [Service]
# Type=simple
# ExecStart=/etc/domain-detective/script.sh
# [Install]
# WantedBy=multi-user.target" > /etc/systemd/system/domain-detective.service
# sudo systemctl daemon-reload
# sudo systemctl enable domain-detective.service
# sudo systemctl start domain-detective.service