Doron Shoham schrieb:
> Add -d flag.
> Delete all the targets and backup the current conf file

(...)

> +# Delete all the targets and backup the current conf file
> +sub delete {
> +     print "deleting targets...\n";
> +     print "a copy of the conf file is on:/etc/tgt/targets.conf.bkp\n";
> +     `mv $configfile /etc/tgt/targets.conf.bkp`;
> +     open FILE, ">", "$configfile" or die $!;
> +     print FILE "<target>\n";
> +     print FILE "</target>\n";

It essentially removes our config file if we accidentally run this 
command twice in a row.
I wouldn't be very happy if I lost configuration of dozens of targets...


Why are we touching the config file here anyway?
IMO, "-d" flag should just remove all targets from a running tgtd; it 
shouldn't try to backup or modify the config file.


-- 
Tomasz Chmielewski
http://wpkg.org
_______________________________________________
Stgt-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/stgt-devel

Reply via email to