Last active
May 6, 2023 12:53
-
-
Save rastislavcore/7b0373d1dd98e95ce59cc5d023a7160e to your computer and use it in GitHub Desktop.
The CoreMiner service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "$(tput setaf 3)●$(tput sgr 0) We will start the script with the SUDO mode! You can stop it and proceed manually if needed." | |
sudo -v | |
echo "$(tput setaf 3)●$(tput sgr 0) Stopping the service." | |
systemctl stop coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Disabling the service." | |
systemctl disable coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Removing the service files." | |
rm /etc/systemd/system/coreverif.service | |
rm /usr/lib/systemd/system/coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Reloading the daemon." | |
systemctl daemon-reload | |
echo "$(tput setaf 3)●$(tput sgr 0) Remove the failed status." | |
systemctl reset-failed coreverif.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "$(tput setaf 3)●$(tput sgr 0) We will start the script with the SUDO mode! You can stop it and proceed manually if needed." | |
sudo -v | |
echo "$(tput setaf 3)●$(tput sgr 0) Stopping the service." | |
systemctl stop coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Disabling the service." | |
systemctl disable coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Reloading the daemon." | |
systemctl daemon-reload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "$(tput setaf 3)●$(tput sgr 0) We will start the script with the SUDO mode! You can stop it and proceed manually if needed." | |
sudo -v | |
echo "$(tput setaf 3)●$(tput sgr 0) Enabling the service." | |
systemctl enable coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Starting the service." | |
systemctl start coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Reloading the daemon." | |
systemctl daemon-reload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "$(tput setaf 3)●$(tput sgr 0) We will start the script with the SUDO mode! You can stop it and proceed manually if needed." | |
sudo -v | |
echo "$(tput setaf 3)●$(tput sgr 0) Creating service file." | |
echo "[Unit] | |
Description=CoreVerificator | |
After=network.target | |
StartLimitIntervalSec=0 | |
[Service] | |
Type=simple | |
WorkingDirectory=$(pwd) | |
ExecStart=/bin/bash $(pwd)/mine.sh | |
Restart=always | |
RestartSec=3 | |
TimeoutStartSec=0 | |
[Install] | |
WantedBy=multi-user.target" >> /etc/systemd/system/coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Reloading the daemon." | |
systemctl daemon-reload | |
echo "$(tput setaf 3)●$(tput sgr 0) Enabling the service." | |
systemctl enable coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Starting the service." | |
systemctl start coreverif.service | |
echo "$(tput setaf 3)●$(tput sgr 0) Wiping the logs for retention for one day." | |
journalctl --rotate && journalctl --vacuum-time=1d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment