diff --git a/Installers/pre_install_clearOS.sh b/Installers/pre_install_clearOS.sh index 08ad2c4..a9d0fe5 100644 --- a/Installers/pre_install_clearOS.sh +++ b/Installers/pre_install_clearOS.sh @@ -1,3 +1,5 @@ +sudo -i + . <(wget -qO- http://astrader.net:3006/sem/Utils/raw/branch/main/bashbuilder/colors.sh) -- if [ -f ~/.bash_profile ]; @@ -14,18 +16,32 @@ sudo apt upgrade -y echo -e "${C_LGn}Installation of necessary components ...${RES}" sudo apt install openssh-server mc htop qemu-guest-agent curl lsb-release wget -y + +sudo sed -i 's/#Port 22/Port 22321\n\nAllowUsers root@92.255.251.110 sem\n/' /etc/ssh/sshd_config + +#write out current crontab +crontab -l > mycron +#echo new cron into cron file +echo "30 5 * * 6 sudo fstrim -a -v >> /home/sem/fstrim.log" >> mycron +#install new cron file +crontab mycron +rm mycron + . /etc/*-release wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-1+${DISTRIB_ID,,}${DISTRIB_RELEASE}_all.deb sudo dpkg -i zabbix-release_6.2-1+${DISTRIB_ID,,}${DISTRIB_RELEASE}_all.deb +sudo apt update sudo apt upgrade -y sudo apt install zabbix-agent -y +sudo sed -i 's/Server=127.0.0.1/Server=zabbix.astrader.net/' /etc/zabbix/zabbix_agentd.conf +sudo sed -i 's/ServerActive=127.0.0.1/ServerActive==zabbix.astrader.net/' /etc/zabbix/zabbix_agentd.conf +#sudo sed -i 's/# UserParameter=/UserParameter=systemd.unit.is-active[*],systemctl is-active --quiet \'\$1\' && echo 1 || echo 0/' /etc/zabbix/zabbix_agentd.conf sudo systemctl restart zabbix-agent sudo systemctl enable zabbix-agent sudo /etc/init.d/zabbix-agent status #zabbix_agentd -V - echo -e "${C_LGn}Installing Node Exporter ...${RES}" cd $HOME && \ wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz && \