Skip to content

Commit 1a03291

Browse files
more improved
1 parent 71f963d commit 1a03291

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM phusion/baseimage
2+
23
MAINTAINER lovebootcaptain <@lovebootcaptain>
34

45
ARG SETLANG

scripts/LoopConverter

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
#!/bin/sh
22

3-
EXT=ts
3+
EXT=$1
44

5-
for i in *; do
6-
if [ "${i}" != "${i%.${EXT}}" ];then
7-
echo "convertible file found: $i"
8-
fi
9-
done
5+
if [ $# -eq 0 ]
6+
then
7+
echo "No arguments supplied"
8+
echo "usage: LoopConverter [file extension to convert]"
9+
echo "e.g.: LoopConverter mkv /path/to/your/folder"
10+
11+
else
12+
for i in *
13+
do
14+
if [ "${i}" != "${i%.${EXT}}" ];then
15+
echo "convertible file found: $i"
16+
fi
17+
done
18+
19+
for i in *
20+
do
21+
if [ "${i}" != "${i%.${EXT}}" ];then
22+
echo "converting file $i"
23+
# convert "$i"
24+
fi
25+
done
26+
fi
1027

11-
for i in *; do
12-
if [ "${i}" != "${i%.${EXT}}" ];then
13-
echo "converting file $i"
14-
convert "$i"
15-
fi
16-
done

scripts/convert

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
NOW=$(date +"%m%d%Y")
44
PGMNAME=/usr/bin/HandBrakeCLI
5+
56
check_errs()
67
{
78
# Function. Parameter 1 is the return code
@@ -24,5 +25,3 @@ check_errs $? "Failed to convert file $1"
2425
echo "Removing original file."
2526
rm -f "$1"
2627
check_errs $? "Failed to remove original file $1"
27-
28-
exit

0 commit comments

Comments
 (0)