Skip to content

Commit

Permalink
Crontab
Browse files Browse the repository at this point in the history
Tried adding a crontab install routine to the configure script.  YMMV.
  • Loading branch information
Jason Todd committed Nov 30, 2020
1 parent 66f9ef0 commit 0b61af6
Show file tree
Hide file tree
Showing 44 changed files with 23 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
_site/*
vendor/*
.jekyll-cache

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exclude:
- weather.sh
- send-mail.sh
- configure.sh
- crontab.install
- .git/*
- .github/*
- .gitignore
Expand Down
21 changes: 20 additions & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,25 @@ read -p "Ready? Press any key to continue."
clear
wget -S -qO- https://forecast.weather.gov/zipcity.php?inputstring=$zipcode | grep Location\:
read -p "Enter the three letters you wrote down: " office
echo -e "\n"

# Build the required files
# Install crontab
echo -e "\n"
echo -e "-------------------------------------------------------------------------------"
echo -e "\nInstalling crontab file."
echo -e "-------------------------------------------------------------------------------"
user=$(whoami)
echo "MAILTO=''" > crontab.install
echo "0 4-19 * * * $dir/weather.sh >/dev/null 2>&1" >> crontab.install
echo "0 5 * * * $dir/send-mail.sh >/dev/null 2>&1 >> crontab.install
crontab -u $user crontab.install
sudo systemctl restart crond
# Build the required files
echo -e "\n"
echo -e "-------------------------------------------------------------------------------"
echo -e "\nBuilding configuration files."
echo -e "-------------------------------------------------------------------------------"
echo "#!/bin/bash\n" > config
echo "# Generated by configure.sh at $(date)" >> config
echo "#" >> config
Expand All @@ -142,6 +158,7 @@ echo "email='$email'" >> config
echo "from='$from'" >> config
echo "office=$office" >> config
echo "zipcode=$zipcode" >> config
echo "user=$user" >> config

echo "---" > index.md
echo "layout: default" >> index.md
Expand All @@ -152,6 +169,8 @@ echo "license: LICENSE" >> index.md
echo "logo: $logo" >> index.md
echo "title: $title" >> index.md



echo -e "-------------------------------------------------------------------------------"
echo -e "Configuration complete!"
echo -e "You are probably going to have to edit the weather.sh file to get and display"
Expand Down
1 change: 1 addition & 0 deletions crontab.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file removed vendor/cache/activesupport-6.0.3.4.gem
Binary file not shown.
Binary file removed vendor/cache/addressable-2.7.0.gem
Binary file not shown.
Binary file removed vendor/cache/colorator-1.1.0.gem
Binary file not shown.
Binary file removed vendor/cache/concurrent-ruby-1.1.7.gem
Binary file not shown.
Binary file removed vendor/cache/em-websocket-0.5.2.gem
Binary file not shown.
Binary file removed vendor/cache/eventmachine-1.2.7.gem
Binary file not shown.
Binary file removed vendor/cache/ffi-1.13.1.gem
Binary file not shown.
Binary file removed vendor/cache/forwardable-extended-2.6.0.gem
Binary file not shown.
Binary file removed vendor/cache/html-pipeline-2.14.0.gem
Binary file not shown.
Binary file removed vendor/cache/http_parser.rb-0.6.0.gem
Binary file not shown.
Binary file removed vendor/cache/i18n-1.8.5.gem
Binary file not shown.
Binary file removed vendor/cache/jekyll-4.1.1.gem
Binary file not shown.
Binary file removed vendor/cache/jekyll-deploy-0.0.2.gem
Binary file not shown.
Binary file removed vendor/cache/jekyll-mentions-1.6.0.gem
Binary file not shown.
Binary file removed vendor/cache/jekyll-sass-converter-2.1.0.gem
Binary file not shown.
Binary file removed vendor/cache/jekyll-watch-2.2.1.gem
Binary file not shown.
Binary file removed vendor/cache/jekyll-webp-1.0.0.gem
Binary file not shown.
Binary file removed vendor/cache/kramdown-2.3.0.gem
Binary file not shown.
Binary file removed vendor/cache/kramdown-parser-gfm-1.1.0.gem
Binary file not shown.
Binary file removed vendor/cache/liquid-4.0.3.gem
Binary file not shown.
Binary file removed vendor/cache/listen-3.3.2.gem
Binary file not shown.
Binary file removed vendor/cache/mercenary-0.4.0.gem
Binary file not shown.
Binary file removed vendor/cache/mini_portile2-2.4.0.gem
Binary file not shown.
Binary file removed vendor/cache/minitest-5.14.2.gem
Binary file not shown.
Binary file removed vendor/cache/nokogiri-1.10.10.gem
Binary file not shown.
Binary file removed vendor/cache/pathutil-0.16.2.gem
Binary file not shown.
Binary file removed vendor/cache/public_suffix-4.0.6.gem
Binary file not shown.
Binary file removed vendor/cache/rb-fsevent-0.10.4.gem
Binary file not shown.
Binary file removed vendor/cache/rb-inotify-0.10.1.gem
Binary file not shown.
Binary file removed vendor/cache/rexml-3.2.4.gem
Binary file not shown.
Binary file removed vendor/cache/rouge-3.25.0.gem
Binary file not shown.
Binary file removed vendor/cache/safe_yaml-1.0.5.gem
Binary file not shown.
Binary file removed vendor/cache/sassc-2.4.0.gem
Binary file not shown.
Binary file removed vendor/cache/terminal-table-1.8.0.gem
Binary file not shown.
Binary file removed vendor/cache/thread_safe-0.3.6.gem
Binary file not shown.
Binary file removed vendor/cache/tzinfo-1.2.8.gem
Binary file not shown.
Binary file removed vendor/cache/unicode-display_width-1.7.0.gem
Binary file not shown.
Binary file removed vendor/cache/zeitwerk-2.4.2.gem
Binary file not shown.

0 comments on commit 0b61af6

Please sign in to comment.