1

I made a script for checking the presence of *.m3u8 files from .csv file.

If the link is absent the *.m3u8 file is not downloaded.

How to do:

  1. If the file download errors out, create an empty file with name - "file"+"fake".m3u8

for example:

wget http://ex.ua/files/heroes.m3u8` 

this url is absent, so create file - heroesfake.m3u8

Zanna
  • 72,312
Oleksii
  • 353

1 Answers1

1

Have a look at How to check if a command succeeded?

For example:

#! /bin/bash
#
wget http://ex.ua/files/heroes.m3u8
if [ $? -ne 0 ]; then
    touch heroes-fake.m3u8
fi
Rmano
  • 32,167