HEX
Server: Apache
System: Linux server3230.server-vps.com 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: lzgqnjwu (1002)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //var/tmp0/brainy/ssh/crontab
#!/bin/bash

if [ $# -eq 0 ]; then
    echo "No arguments provided"
    exit 1
fi

action=$1;
os=$2;

if [ "${action}" == "install" ]; then
    if [ "${os}" == "debian8" ]; then
	apt-get install cron -y --force-yes
	systemctl enable cron
	systemctl start cron
    elif [ "${os}" == "ubuntu" ]; then
	apt-get -y install cronie
	systemctl enable crond
	systemctl start crond
    else
	yum -y install cronie
	service crond start
	chkconfig crond on
    fi
fi

if [ "${action}" == "delete" ]; then
    if [ "${os}" == "debian8" ]; then
	systemctl stop cron
	apt-get remove cron -y && aptitude purge ~c -y
    elif [ "${os}" == "ubuntu" ]; then
	systemctl stop crond
	apt-get -y remove --purge cronie
    else
	service stop cron
	yum -y erase cronie
    fi
fi

if [ "${action}" == "reinstall" ]; then
    if [ "${os}" == "debian8" ]; then
	systemctl cron stop
	apt-get remove cron -y && aptitude purge ~c -y
	apt-get install cron -y --force-yes
	systemctl enable cron
	systemctl start cron
    elif [ "${os}" == "ubuntu" ]; then
	systemctl stop crond
	apt-get -y remove --purge cronie
	apt-get -y install cronie
	systemctl enable cron
	systemctl start cron
    else
	yum -y erase cronie
	yum -y install cronie
	service crond start
	chkconfig crond on
    fi
fi