#!/usr/local/bin/perl
# restart_sharing.cgi
# Call unshareall and shareall to stop and re-start file sharing

require './dfs-lib.pl';
$whatfailed = "Failed to apply changes";

$temp = &tempname();
&system_logged("$config{unshare_all_command} >/dev/null 2>&1");
&system_logged("$config{share_all_command} >/dev/null 2>$temp");
$why = `/bin/cat $temp`;
unlink($temp);
if ($why =~ /\S+/) {
	&error("Share failed : </h2><pre>$why</pre>");
	}
unlink($temp);
&webmin_log("apply");
&redirect("");

