Untitled
public text v1 · immutable#!/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";
?>