Use basename to avoid slashes

This commit is contained in:
Bob Mottram 2018-04-01 19:34:58 +01:00
parent d3e6ffb09a
commit ff6866d686
1 changed files with 3 additions and 3 deletions

View File

@ -110,10 +110,10 @@ function peertube_import_from_syncthing {
echo " peertubetitle=\$(basename \"\$video_file\" | awk -F '.' '{print \$1}' | sed 's|_| |g' | sed 's|-| |g')";
echo " if $nodecmd \$import_script -n \$peertubetitle \$peertubensfw \$peertubeprivate -u \"\$peertubedomain\" -U \"\$peertubeuser\" --password \"\$peertubepassword\" -f \"\$video_file\"; then";
echo " echo \"\$video_file\" >> /root/.peertube_uploaded";
echo " sed -i \"/\$video_file/d\" /root/.peertube_uploading";
echo " sed -i \"/\$(basename \$video_file)/d\" /root/.peertube_uploading";
echo " exit 0";
echo ' else';
echo " sed -i \"/\$video_file/d\" /root/.peertube_uploading";
echo " sed -i \"/\$(basename \$video_file)/d\" /root/.peertube_uploading";
echo " failed_uploads=\$((failed_uploads+1))";
echo " if [ \$failed_uploads -gt 1 ]; then";
echo ' exit 0';
@ -122,7 +122,7 @@ function peertube_import_from_syncthing {
echo ' fi';
echo ' else';
echo " if grep -q \"\$video_file\" /root/.peertube_uploading; then";
echo " sed -i \"/\$video_file/d\" /root/.peertube_uploading";
echo " sed -i \"/\$(basename \$video_file)/d\" /root/.peertube_uploading";
echo ' fi';
echo ' fi';
echo ' fi';