/
install
executable file
·40 lines (36 loc) · 1.12 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
FFMPEGLOC=$(which ffmpeg)
CURL_EXISTS=$(command -v "curl")
WGET_EXISTS=$(command -v "wget")
if [ -z $CURL_EXISTS ] && [ -z $WGET_EXISTS ]; then
echo "Please install either wget or curl"
exit 1
fi
if [ -z "$FFMPEGLOC" ]; then
echo "No FFmpeg found"
else
echo "FFmpeg was found at "$FFMPEGLOC
echo "Removing old FFmpeg"
rm -rf $FFMPEGLOC
echo "Done"
fi
if [ ! -f "ffmpeg" ]; then
if [ $WGET_EXISTS ]; then
wget "https://github.com/XniceCraft/ffmpeg-colab/releases/download/6.0/ffmpeg" -O ffmpeg
elif [ $CURL_EXISTS ]; then
curl -o ffmpeg "https://github.com/XniceCraft/ffmpeg-colab/releases/download/6.0/ffmpeg"
fi
fi
if [ -f "ffmpeg" ]; then
echo "Moving new ffmpeg to /usr/bin"
chmod +x ffmpeg
if [ $(mv ffmpeg "/usr/bin/"; echo $?) != 0 ]; then
echo "Failed move ffmpeg to /usr/bin"
echo "Moving new ffmpeg to /usr/local/bin"
if [ $(mv ffmpeg "/usr/local/bin/"; echo $?) != 0 ]; then
echo "Installation failed. Please check your permission"
exit 1
fi
fi
echo "FFmpeg was successfully installed"
fi