forked from Avix101/Mail-Server-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrontab.sh
More file actions
executable file
·23 lines (18 loc) · 744 Bytes
/
crontab.sh
File metadata and controls
executable file
·23 lines (18 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
#
#-----------------------------------------#
###Welcome to the crontab setup script.
#-----------------------------------------#
sudo $package_manager install cronie -y
sudo crontab -u amavis -r
sudo crontab -u amavis -l | { cat; echo "0 5 * * * nohup time /mnt/vmail/learn.sh spam >> /mnt/vmail/learn-spam.nohup 2>&1 &
0 7 * * 0 nohup time /mnt/vmail/learn.sh ham >> /mnt/vmail/learn-ham.nohup 2>&1 &"; } | sudo crontab -u amavis -
temp="$(grep ^pass learn.sh)"
if [ "$temp" != "" ]; then
echo "Updating variable..."
sudo ./perl-find-replace "$temp" "pass=$database_pass" "learn.sh"
else
echo "Writing variable..."
echo "pass=$database_pass" | sudo tee -a "learn.sh"
fi
sudo cp learn.sh /mnt/vmail/learn.sh