return $b;
}
+sub _config_del {
+ my $path = shift;
+
+ _debug("config: removing %s", join('.', @{$path}));
+ $remote_api->{config_del}->($path);
+}
+
#
# The _config_list_* are helper functions taking a path to a comma separated
# string. The string is interpreted as a list and the action performed
}
_debug("Removing %s from list %s", $item, join('.', @{$path}));
- @c = map { $item ne $_ } split(/\s*,\s*/, _config_get($path));
+ @c = grep { $item ne $_ } split(/\s*,\s*/, _config_get($path));
- _config_set($path, join('.', @c));
+ _config_set($path, join(',', @c));
}
#
$name = lc($name);
+ unless($name =~ m|^[a-z]+$|) {
+ _io("%s is not a valid connector name (only letters are allowed)", $name);
+ return;
+ }
+
if (_config_list_has(['defined-connectors'], $name)) {
_io("Connector already exists");
return;