forked from MunifTanjim/scripts.sh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-popcorntime
executable file
·38 lines (31 loc) · 1.07 KB
/
setup-popcorntime
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
#!/usr/bin/env bash
cd /tmp || exit
echo "Installing PopcornTime..."
_popcorntime_version=${1:-"0.3.10"}
_popcorntime_platform=${2:-"Linux-64"}
_popcorntime_url="https://get.popcorntime.sh/build/Popcorn-Time-${_popcorntime_version}-${_popcorntime_platform}.tar.xz"
_popcorntime_dir="/opt/PopcornTime"
echo "Downloading Source Archive..."
wget -q --show-progress ${_popcorntime_url} -O popcorntime.tar.xz
rm -rf PopcornTime && mkdir -p PopcornTime
tar -Jxf popcorntime.tar.xz -C ./PopcornTime
rm popcorntime.tar.xz
echo "Installation Directory: ${_popcorntime_dir}"
if [[ -d "${_popcorntime_dir}" ]]; then
sudo rm -rf ${_popcorntime_dir}
fi
sudo mv PopcornTime ${_popcorntime_dir}
echo "Setting up PopcornTime binary: popcorntime"
sudo ln -nsf ${_popcorntime_dir}/Popcorn-Time /usr/bin/popcorntime
echo "Adding Application Shortcut..."
cat > ${HOME}/.local/share/applications/popcorntime.desktop <<EOL
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=PopCorn Time
Exec=popcorntime
Icon=${_popcorntime_dir}/src/app/images/icon.png
Categories=Application;
EOL
echo "Done!"