david/myzsh
david
/
myzsh
Archived
1
0
Fork 0

pushzshconfig 18.01.2013 16:50

This commit is contained in:
david 2013-01-18 16:50:33 +01:00
parent a640b78422
commit 14a62e3a29
1 changed files with 15 additions and 8 deletions

View File

@ -1,14 +1,21 @@
# run myzsh update (every 7 days)
timestamp=$(date +%s)
lastrun=$(cat $ZSH/lastrun)
if [ $((lastrun+604800)) -le $timestamp ]; then
echo -e "do you want to update myzsh? [y/n] \c"
read choice
if [ $choice = "y" ]; then
echo "running update of myzsh now.."
cd $ZSH; git pull origin master; cd -
echo $timestamp > $ZSH/lastrun
if [ -r $ZSH/lastrun ];then
lastrun=$(cat $ZSH/lastrun)
if [ $((lastrun+604800)) -le $timestamp ]; then
echo -e "do you want to update myzsh? [y/n] \c"
read choice
if [ $choice = "y" ]; then
echo "running update of myzsh now.."
cd $ZSH; git pull origin master; cd -
echo $timestamp > $ZSH/lastrun
else
# do not ask again for another day
echo $((timestamp+86400)) > $ZSH/lastrun
fi
fi
else
echo $timestamp > $ZSH/lastrun
fi