pushzshconfig 18.01.2013 16:50
This commit is contained in:
parent
a640b78422
commit
14a62e3a29
23
myzsh.sh
23
myzsh.sh
|
@ -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
|
||||
|
||||
|
||||
|
|
Reference in New Issue