22 lines
329 B
Bash
Executable File
22 lines
329 B
Bash
Executable File
#!/bin/sh
|
|
set -x
|
|
set -e
|
|
dir=~/.crontab
|
|
mkdir -p "$dir"
|
|
cd "$dir"
|
|
if [ ! -d .git ]
|
|
then
|
|
git init
|
|
fi
|
|
crontab -l > crontab
|
|
git add crontab
|
|
git status | grep "nothing to commit, working tree clean" || git commit
|
|
sensible-editor crontab
|
|
git add crontab
|
|
git commit
|
|
crontab crontab
|
|
if [ -n "$(git remote)" ]
|
|
then
|
|
git push -u
|
|
fi
|