Adjust code
This commit is contained in:
		
							parent
							
								
									a0d2b34297
								
							
						
					
					
						commit
						d66d0d55b1
					
				|  | @ -1,37 +1,34 @@ | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
| Github=https://github.com/Hyy2001X/Openwrt-AutoUpdate | AutoUpdate_Github=https://github.com/Hyy2001X/Openwrt-AutoUpdate | ||||||
| 
 | 
 | ||||||
| ExtraPackages_GIT() { | ExtraPackages() { | ||||||
| [ -d ./package/lean/$1 ] && rm -rf ./package/lean/$1 | [ -d ./package/lean/$2 ] && rm -rf ./package/lean/$2 | ||||||
| while [ ! -f $1/Makefile ] | [ -d ./$2 ] && rm -rf ./$2 | ||||||
|  | while [ ! -f $2/Makefile ] | ||||||
| do | do | ||||||
| 	echo "Checking out $1 from $2 ..." > /dev/null 2>&1 | 	echo "Checking out $2 from $3 ..." | ||||||
| 	git clone -b $3 $2/$1 $1 | 	if [ $1 == git ];then | ||||||
| 	[ ! -f $1/Makefile ] && echo "Checkout failed,retry in 3s." && sleep 3 | 		git clone -b $4 $3/$2 $2 > /dev/null 2>&1 | ||||||
|  | 	else | ||||||
|  | 		svn checkout $3/$2 $2 > /dev/null 2>&1 | ||||||
|  | 	fi | ||||||
|  | 	if [ ! -f $2/Makefile ];then | ||||||
|  | 		echo "Checkout failed,retry in 3s." | ||||||
|  | 		rm -rf $2 > /dev/null 2>&1 | ||||||
|  | 		sleep 3 | ||||||
|  | 	fi | ||||||
| done | done | ||||||
| echo "Package $1 detected!" | echo "Package $2 detected!" | ||||||
| mv $1 ./package/lean | mv $2 ./package/lean | ||||||
| } |  | ||||||
| 
 |  | ||||||
| ExtraPackages_SVN() { |  | ||||||
| [ -d ./package/lean/$1 ] && rm -rf ./package/lean/$1 |  | ||||||
| while [ ! -f $1/Makefile ] |  | ||||||
| do |  | ||||||
| 	echo "Checking out $1 from $2 ..." |  | ||||||
| 	svn checkout $2/$1 $1 > /dev/null 2>&1 |  | ||||||
| 	[ ! -f $1/Makefile ] && echo "Checkout failed,retry in 3s." && sleep 3 |  | ||||||
| done |  | ||||||
| echo "Package $1 detected!" |  | ||||||
| mv $1 ./package/lean |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| sed -i "s/#src-git helloworld/src-git helloworld/g" feeds.conf.default | sed -i "s/#src-git helloworld/src-git helloworld/g" feeds.conf.default | ||||||
| ExtraPackages_GIT luci-theme-argon https://github.com/jerrykuku 18.06 | ExtraPackages git luci-theme-argon https://github.com/jerrykuku 18.06 | ||||||
| ExtraPackages_SVN luci-app-openclash https://github.com/vernesong/OpenClash/trunk | ExtraPackages svn luci-app-openclash https://github.com/vernesong/OpenClash/trunk | ||||||
| ExtraPackages_SVN luci-app-adguardhome https://github.com/Lienol/openwrt/trunk/package/diy | ExtraPackages svn luci-app-adguardhome https://github.com/Lienol/openwrt/trunk/package/diy | ||||||
| ExtraPackages_SVN luci-app-smartdns https://github.com/project-openwrt/openwrt/trunk/package/ntlf9t | ExtraPackages svn luci-app-smartdns https://github.com/project-openwrt/openwrt/trunk/package/ntlf9t | ||||||
| ExtraPackages_SVN smartdns https://github.com/project-openwrt/openwrt/trunk/package/ntlf9t | ExtraPackages svn smartdns https://github.com/project-openwrt/openwrt/trunk/package/ntlf9t | ||||||
| [ -d ./Openwrt-AutoUpdate ] && rm -rf ./Openwrt-AutoUpdate | [ -d ./Openwrt-AutoUpdate ] && rm -rf ./Openwrt-AutoUpdate | ||||||
| git clone $Github | git clone -b master $AutoUpdate_Github | ||||||
| mv Openwrt-AutoUpdate/AutoUpdate.sh ./package/base-files/files/bin | mv Openwrt-AutoUpdate/AutoUpdate.sh ./package/base-files/files/bin | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue