42 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/bash
 | |
| #===================================================================
 | |
| # Filename   : update_github.sh
 | |
| # Function   :
 | |
| # Usage      :
 | |
| # Author     : Manford Fan
 | |
| # Date       : 2022-03-26 18:46
 | |
| # Version    : Version 0.1
 | |
| # Disclaimer : The author is NOT responsible for any loss caused
 | |
| #              by the user's own operations.
 | |
| # And More   : If you find there are some bugs in this scripts
 | |
| #              Or you have better ideas, please do contact me
 | |
| #              via E-mail -- mffan0922@163.com
 | |
| #===================================================================
 | |
| 
 | |
| t=`date +%Y%m%d%H%M%S`
 | |
| echo $t >> /opt/logs/github_update.log
 | |
| 
 | |
| # first try
 | |
| # echo -n "1-blog: "
 | |
| # cd /opt/source-code/blog && git pull --rebase
 | |
| # echo -n "1-wiki: "
 | |
| # cd /opt/websites/wiki && git pull --rebase
 | |
| # echo -n "1-nav: "
 | |
| # cd /opt/websites/nav && git pull --rebase
 | |
| echo -n "1-homepage: "
 | |
| cd /opt/websites/homepage && git pull --rebase
 | |
| 
 | |
| # check if done
 | |
| # echo -n "2-blog: "
 | |
| # cd /opt/source-code/blog && git pull --rebase
 | |
| # echo -n "2-wiki: "
 | |
| # cd /opt/websites/wiki && git pull --rebase
 | |
| # echo -n "2-nav: "
 | |
| # cd /opt/websites/nav && git pull --rebase
 | |
| echo -n "2-homepage: "
 | |
| cd /opt/websites/homepage && git pull --rebase
 | |
| 
 | |
| echo -e "-----------------------------------------------------------\n"
 | |
| 
 | |
| 
 |