mirror of
				https://github.com/RangeNetworks/openbts.git
				synced 2025-11-03 21:33:15 +00:00 
			
		
		
		
	syncing commonlibs with Many thanks to Michael Iedema for these patches, makes config a lot better.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5655 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
		
							
								
								
									
										29
									
								
								CLI/CLI.cpp
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								CLI/CLI.cpp
									
									
									
									
									
								
							@@ -515,23 +515,30 @@ int config(int argc, char** argv, ostream& os)
 | 
			
		||||
	return SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Remove a configiuration value. */
 | 
			
		||||
/** Disable a configuration key. */
 | 
			
		||||
int unconfig(int argc, char** argv, ostream& os)
 | 
			
		||||
{
 | 
			
		||||
	if (argc!=2) return BAD_NUM_ARGS;
 | 
			
		||||
 | 
			
		||||
	if (gConfig.unset(argv[1])) {
 | 
			
		||||
		os << "\"" << argv[1] << "\" removed from the configuration table" << endl;
 | 
			
		||||
		return SUCCESS;
 | 
			
		||||
	if (!gConfig.defines(argv[1])) {
 | 
			
		||||
		os << argv[1] << " is not in the table" << endl;
 | 
			
		||||
		return BAD_VALUE;
 | 
			
		||||
	}
 | 
			
		||||
	if (gConfig.defines(argv[1])) {
 | 
			
		||||
		os << "\"" << argv[1] << "\" could not be removed" << endl;
 | 
			
		||||
	} else {
 | 
			
		||||
		os << "\"" << argv[1] << "\" was not in the table" << endl;
 | 
			
		||||
	}
 | 
			
		||||
	return BAD_VALUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
	if (gConfig.keyDefinedInSchema(argv[1]) && !gConfig.isValidValue(argv[1], "")) {
 | 
			
		||||
		os << argv[1] << " is not disableable" << endl;
 | 
			
		||||
		return BAD_VALUE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!gConfig.set(argv[1], "")) {
 | 
			
		||||
		os << "DB ERROR: " << argv[1] << " could not be disabled" << endl;
 | 
			
		||||
		return FAILURE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	os << argv[1] << " disabled" << endl;
 | 
			
		||||
 | 
			
		||||
	return SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Dump current configuration to a file. */
 | 
			
		||||
int configsave(int argc, char** argv, ostream& os)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user