mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Try to fix config update when importing old config
This commit is contained in:
		
							parent
							
								
									a8e0c0642e
								
							
						
					
					
						commit
						5896616ad5
					
				
					 2 changed files with 18 additions and 11 deletions
				
			
		
							
								
								
									
										14
									
								
								openmptcprouter/files/etc/uci-defaults/0000-omr-update
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								openmptcprouter/files/etc/uci-defaults/0000-omr-update
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
cd /etc/uci-defaults || exit 0
 | 
			
		||||
source /etc/os-release
 | 
			
		||||
 | 
			
		||||
files="$(ls /etc/uci-defaults/)"
 | 
			
		||||
[ -n "$files" ] && {
 | 
			
		||||
	mkdir -p /usr/share/omr-update
 | 
			
		||||
	if [ "$(grep rom /etc/mtab)" = "" ]; then
 | 
			
		||||
		rm /usr/share/omr-update/*
 | 
			
		||||
		cp /etc/uci-defaults/* /usr/share/omr-update
 | 
			
		||||
	fi
 | 
			
		||||
}
 | 
			
		||||
exit 0
 | 
			
		||||
| 
						 | 
				
			
			@ -4,15 +4,8 @@ cd /etc/uci-defaults || exit 0
 | 
			
		|||
source /etc/os-release
 | 
			
		||||
 | 
			
		||||
OMRVERSION=$(echo $VERSION | sed 's/v//')
 | 
			
		||||
files="$(ls /etc/uci-defaults/)"
 | 
			
		||||
[ -n "$files" ] && {
 | 
			
		||||
	mkdir -p /usr/share/omr-update
 | 
			
		||||
	if [ "$(grep rom /etc/mtab)" = "" ]; then
 | 
			
		||||
		rm /usr/share/omr-update/*
 | 
			
		||||
		cp /etc/uci-defaults/* /usr/share/omr-update
 | 
			
		||||
	fi
 | 
			
		||||
	uci -q set openmptcprouter.settings=settings
 | 
			
		||||
	uci -q set openmptcprouter.settings.version=${OMRVERSION}
 | 
			
		||||
	uci -q commit
 | 
			
		||||
}
 | 
			
		||||
uci -q set openmptcprouter.settings=settings
 | 
			
		||||
uci -q set openmptcprouter.settings.version=${OMRVERSION}
 | 
			
		||||
uci -q commit
 | 
			
		||||
 | 
			
		||||
exit 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue