-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitialize.sh
executable file
·33 lines (31 loc) · 933 Bytes
/
initialize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash -
#===============================================================================
#
# FILE: initialize.sh
#
# USAGE: ./initialize.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: YOUR NAME (),
# ORGANIZATION:
# CREATED: 2017-11-20 16:11:09
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
echo "Initializing ..."
echo "Creating a cronjob for the script"
echo "Creating new cronfile to install"
#write out current crontab
crontab -l > mycron
#echo new cron into cron file
echo "10 * * * * SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin $HOME/scripting/fetch-hook.sh" >> mycron
#install new cron file
echo "Installing new cronfile"
crontab mycron
echo "Cleanup ..."
rm mycron