home up updated.
This commit is contained in:
parent
cdb4fb3a41
commit
9ba94267a4
1 changed files with 14 additions and 2 deletions
|
|
@ -30,8 +30,20 @@ function home() {
|
||||||
;;
|
;;
|
||||||
up)
|
up)
|
||||||
cd ~
|
cd ~
|
||||||
git pull
|
last_update=$(stat -c %Y .lastupdate)
|
||||||
git submodule update --init --recursive
|
current_date=$(date +%s)
|
||||||
|
time_diff=$(($current_date-$last_update))
|
||||||
|
if (( time_diff > 86400 )); then
|
||||||
|
git pull
|
||||||
|
git submodule update --init --recursive
|
||||||
|
elif
|
||||||
|
echo "/home/hanez was already updated in the last 24 hours."
|
||||||
|
echo "Run this to force updating: home up f"
|
||||||
|
if [ "$2" = "x" ]; then
|
||||||
|
git pull
|
||||||
|
git submodule update --init --recursive
|
||||||
|
fi
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "command not found!"
|
echo "command not found!"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue