I divided the settings into several files, so that it would be possible to set up purses and choose a currency, could be shared across several farms. And the map and system settings were locally configured.
EMAIL_TEXT=$1 # take argument and put it to $EMAIL_TEXT
sudo apt-get install libio-socket-ssl-perl libnet-ssleay-perl sendemail -y
# to send email use command ( ./mail.sh X) where X is N of text message.
case $EMAIL_TEXT in
0)
SUBJECT="Starting $WORKER_NAME"
TEXT="System was started just now!"
;;
1)
SUBJECT="Starting $WORKER_NAME"
TEXT="GPU Miner was started just now!"
;;
2)
SUBJECT="Starting $WORKER_NAME"
TEXT="CPU Miner was started just now!"
;;
3)
SUBJECT="Restaring $WORKER_NAME"
TEXT="GPU miner was crushed and restarting now"
;;
4)
SUBJECT="Settings update $WORKER_NAME"
TEXT="New setiings arrived. Restart now"
;;
5)
SUBJECT="Rebooting $WORKER_NAME"
TEXT="Lost GPU so restarting system."
;;
6)
SUBJECT="Rebooting $WORKER_NAME"
TEXT="Utilization is too low: reviving did not work so restarting system in 10 seconds"
;;
7)
SUBJECT="Starting $WORKER_NAME"
TEXT="NICEHASH was started just now!"
;;

SUBJECT="Starting $WORKER_NAME"
TEXT="Gotty was started just now"
;;
*)
SUBJECT="Error $WORKER_NAME"
TEXT="Error with subject!"
;;
esac
sendemail -f $RIG_EMAIL -t $ADMIN_EMAIL -u $SUBJECT -m "$TEXT" -s $RIG_SMTP -o tls=yes -xu $RIG_EMAIL -xp $RIG_EMAIL_PASS &
It will try to install sendemail every time, but it is not problem. Or you can add apt-get in firstBOOT section of 1bash. All arguments must be loaded from 1bash using files. But I don't have time to do it, for now. I am using another way - I add "source ~/wallets # from this file we take $ADMAIL_EMAIL
source ~/settings.sh # from this file we take $RIG_EMAIL, $WORKER_NAME, $RIG_EMAIL_PASS, $RIG_SMTP
".