All pastes #761966 Raw Edit

Untitled

public text v1 · immutable
·published 2007-11-05 05:26 UTC
rendered paste body
#!/usr/bin/php
<?php
	$dir = rtrim($argv[1], '/');

	if ($handle = opendir($dir))
	{
		echo "**** Opened directory $dir for reading.\n";

		while (false !== ($file = readdir($handle)))
		{
            if (is_dir($file))
            {
                $fullpath = $dir.'/'.$file
                shell_exec('transmissioncli -c '.$fullpath.' '.$file.'.torrent');
                echo 'Created .torrent for '. $file ."\n";
            }
		}
	}

    echo "**** Torrent walkabout is complete.\n";
?>