Fix add package: luci-app-openclash
This commit is contained in:
		
							parent
							
								
									d66d0d55b1
								
							
						
					
					
						commit
						cda308e976
					
				|  | @ -1,34 +1,43 @@ | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
|  | Github=https://github.com/Hyy2001X | ||||||
| AutoUpdate_Github=https://github.com/Hyy2001X/Openwrt-AutoUpdate | AutoUpdate_Github=https://github.com/Hyy2001X/Openwrt-AutoUpdate | ||||||
| 
 | 
 | ||||||
| ExtraPackages() { | ExtraPackages() { | ||||||
|  | [ ! -d ./package/lean ] && mkdir ./package/lean | ||||||
| [ -d ./package/lean/$2 ] && rm -rf ./package/lean/$2 | [ -d ./package/lean/$2 ] && rm -rf ./package/lean/$2 | ||||||
| [ -d ./$2 ] && rm -rf ./$2 | [ -d ./$2 ] && rm -rf ./$2 | ||||||
| while [ ! -f $2/Makefile ] | while [ ! -f $2/Makefile ] | ||||||
| do | do | ||||||
| 	echo "Checking out $2 from $3 ..." | 	echo "[$(date "+%H:%M:%S")] Checking out $2 from $3 ..." | ||||||
| 	if [ $1 == git ];then | 	if [ $1 == git ];then | ||||||
| 		git clone -b $4 $3/$2 $2 > /dev/null 2>&1 | 		git clone -b $4 $3/$2 $2 > /dev/null 2>&1 | ||||||
| 	else | 	else | ||||||
| 		svn checkout $3/$2 $2 > /dev/null 2>&1 | 		svn checkout $3/$2 $2 > /dev/null 2>&1 | ||||||
| 	fi | 	fi | ||||||
| 	if [ ! -f $2/Makefile ];then | 	if [ -f $2/Makefile ] || [ -f $2/README* ];then | ||||||
| 		echo "Checkout failed,retry in 3s." | 		echo "[$(date "+%H:%M:%S")] Package/Project $2 detected!" | ||||||
| 		rm -rf $2 > /dev/null 2>&1 | 		if [ $2 == OpenClash ];then | ||||||
|  | 			mv $2/luci-app-openclash ./package/lean | ||||||
|  | 		elif [ $2 == Openwrt-AutoUpdate ];then | ||||||
|  | 			mv $2/AutoUpdate.sh ./package/base-files/files/bin | ||||||
|  | 		else | ||||||
|  | 			mv $2 ./package/lean | ||||||
|  | 		fi | ||||||
|  | 		rm -rf ./$2 > /dev/null 2>&1 | ||||||
|  | 		break | ||||||
|  | 	else | ||||||
|  | 		echo "[$(date "+%H:%M:%S")] Checkout failed,retry in 3s." | ||||||
|  | 		rm -rf ./$2 > /dev/null 2>&1 | ||||||
| 		sleep 3 | 		sleep 3 | ||||||
| 	fi | 	fi | ||||||
| done | done | ||||||
| echo "Package $2 detected!" |  | ||||||
| mv $2 ./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-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 | ExtraPackages git OpenClash https://github.com/vernesong master | ||||||
| git clone -b master $AutoUpdate_Github | ExtraPackages git Openwrt-AutoUpdate https://github.com/Hyy2001X master | ||||||
| mv Openwrt-AutoUpdate/AutoUpdate.sh ./package/base-files/files/bin |  | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue