(function() {
	
	var rule = data.rules[parseInt(request.param.num, 10)] || null;
	
	if (rule === null) return response.error(404);
	
	switch (request.method) {
		case 'PUT':
			var cmd = '';
			
			switch (request.param.action) {
				case 'enable':
					cmd = 'node app-cli.js -mode rule --enable -n ' + request.param.num;
					break;
				case 'disable':
					cmd = 'node app-cli.js -mode rule --disable -n ' + request.param.num;
					break;
			}
			
			child_process.exec(cmd, function(err, stdout, stderr) {
				if (err) return response.error(500);
				
				response.head(200);
				response.end('{}');
			});
			return;
	}

})();
@@ -18,26 +18,14 @@
 var 
-rule = data.rules%5B
+num = 
 pars
@@ -51,16 +51,57 @@
 num, 10)
+.toString(10);%0A%09var rule = data.rules%5Bnum
 %5D %7C%7C nul
@@ -322,38 +322,24 @@
 able -n ' + 
-request.param.
 num;%0A%09%09%09%09%09br
@@ -419,30 +419,16 @@
  -n ' + 
-request.param.
 num;%0A%09%09%09
@@ -625,8 +625,9 @@
 %7D%0A%0A%7D)();
+%0A

Fix same rule parameter validation