mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2025-12-15 07:43:44 +00:00
Add files via upload
This commit is contained in:
@@ -14,19 +14,18 @@
|
|||||||
# ./update-channels-from-git.sh
|
# ./update-channels-from-git.sh
|
||||||
#----
|
#----
|
||||||
|
|
||||||
|
dir=$(pwd)
|
||||||
#----BEGIN EDITABLE VARS----
|
#----BEGIN EDITABLE VARS----
|
||||||
|
if [ $# -gt 1 ]; then
|
||||||
if [ $# -gt 1 ]
|
|
||||||
then
|
|
||||||
echo "ERROR: Please only supply one argument"
|
echo "ERROR: Please only supply one argument"
|
||||||
exit 9999
|
exit 9999
|
||||||
elif [ "$1" == "develop" ]
|
elif [ "$1" == "develop" ]; then
|
||||||
then
|
|
||||||
echo "Downloading the develop branch"
|
echo "Downloading the develop branch"
|
||||||
SCRIPT_TO_EXECUTE_PLUS_ARGS='git clone https://github.com/MoeFwacky/pseudo-channel . --branch develop'
|
SCRIPT_TO_EXECUTE_PLUS_ARGS='git clone https://github.com/mutto233/pseudo-channel . --branch develop'
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Downloading the master branch"
|
echo "Downloading the master branch"
|
||||||
SCRIPT_TO_EXECUTE_PLUS_ARGS='git clone https://github.com/MoeFwacky/pseudo-channel . --branch master'
|
SCRIPT_TO_EXECUTE_PLUS_ARGS='git clone https://github.com/mutto233/pseudo-channel . --branch master'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
OUTPUT_PREV_CHANNEL_PATH=.
|
OUTPUT_PREV_CHANNEL_PATH=.
|
||||||
@@ -45,6 +44,7 @@ if [[ "$FIND_CHANNEL_FOLDERS" == '' ]]
|
|||||||
FIRST_INSTALL=false
|
FIRST_INSTALL=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#----END EDITABLE VARS-------
|
#----END EDITABLE VARS-------
|
||||||
|
|
||||||
|
|
||||||
@@ -93,13 +93,20 @@ read -p 'Number of Channels: ' number_of_channels
|
|||||||
mkdir "pseudo-channel_$num"
|
mkdir "pseudo-channel_$num"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
mkdir github_download
|
||||||
|
cd github_download
|
||||||
|
$SCRIPT_TO_EXECUTE_PLUS_ARGS
|
||||||
|
else
|
||||||
|
mkdir github_download
|
||||||
|
cd github_download
|
||||||
|
$SCRIPT_TO_EXECUTE_PLUS_ARGS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#### Next, let's download the latest master version of information from GitHub and store it in a temporary folder
|
#### Next, let's download the latest master version of information from GitHub and store it in a temporary folder
|
||||||
mkdir github_download
|
#mkdir github_download
|
||||||
cd github_download
|
#cd github_download
|
||||||
$SCRIPT_TO_EXECUTE_PLUS_ARGS
|
#$SCRIPT_TO_EXECUTE_PLUS_ARGS
|
||||||
|
|
||||||
#### If necessary, install the required elements as defined by requirements.txt
|
#### If necessary, install the required elements as defined by requirements.txt
|
||||||
#### Also, ask user for information to fill in the plex_token and pseudo_config files
|
#### Also, ask user for information to fill in the plex_token and pseudo_config files
|
||||||
@@ -188,11 +195,11 @@ if [ "$FIRST_INSTALL" == "true" ]
|
|||||||
done
|
done
|
||||||
if [[ "$enter_commercials" == @("Y"|"y"|"yes"|"Yes"|"YES") ]]
|
if [[ "$enter_commercials" == @("Y"|"y"|"yes"|"Yes"|"YES") ]]
|
||||||
then
|
then
|
||||||
commercials_true=true
|
commercials_true=True
|
||||||
echo "ENTER the name of EACH Plex library defined as COMMERCIALS"
|
echo "ENTER the name of EACH Plex library defined as COMMERCIALS"
|
||||||
echo -n "[" > commercial-libraries.temp
|
echo -n "[" > commercial-libraries.temp
|
||||||
else
|
else
|
||||||
commercials_true=false
|
commercials_true=False
|
||||||
fi
|
fi
|
||||||
while [[ "$enter_commercials" == @(Y|y|Yes|yes|YES) ]]
|
while [[ "$enter_commercials" == @(Y|y|Yes|yes|YES) ]]
|
||||||
do
|
do
|
||||||
@@ -206,7 +213,7 @@ if [ "$FIRST_INSTALL" == "true" ]
|
|||||||
read -p 'Y/N: ' enter_commercials
|
read -p 'Y/N: ' enter_commercials
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
if [[ "$commercials_true" == "true" ]]
|
if [[ "$commercials_true" == "True" ]]
|
||||||
then
|
then
|
||||||
truncate -s-2 commercial-libraries.temp
|
truncate -s-2 commercial-libraries.temp
|
||||||
echo -n "]," >> commercial-libraries.temp
|
echo -n "]," >> commercial-libraries.temp
|
||||||
@@ -234,7 +241,7 @@ if [ "$FIRST_INSTALL" == "true" ]
|
|||||||
sudo sed -i "/.\"TV Shows\" :*./c\ \"TV Shows\" : $tv_libraries" github_download/both-dir/pseudo_config.py # WRITE TV LIBRARIES TO CONFIG
|
sudo sed -i "/.\"TV Shows\" :*./c\ \"TV Shows\" : $tv_libraries" github_download/both-dir/pseudo_config.py # WRITE TV LIBRARIES TO CONFIG
|
||||||
movie_libraries=$(cat movie-libraries.temp)
|
movie_libraries=$(cat movie-libraries.temp)
|
||||||
sudo sed -i "/.\"Movies\" :*./c\ \"Movies\" : $movie_libraries" github_download/both-dir/pseudo_config.py # WRITE MOVIE LIBRARIES TO CONFIG
|
sudo sed -i "/.\"Movies\" :*./c\ \"Movies\" : $movie_libraries" github_download/both-dir/pseudo_config.py # WRITE MOVIE LIBRARIES TO CONFIG
|
||||||
if [[ "$commercials_true" == "true" ]] #WRITE COMMERCIAL LIBRARIES TO CONFIG
|
if [[ "$commercials_true" == "True" ]] #WRITE COMMERCIAL LIBRARIES TO CONFIG
|
||||||
then
|
then
|
||||||
commercial_libraries=$(cat commercial-libraries.temp)
|
commercial_libraries=$(cat commercial-libraries.temp)
|
||||||
sudo sed -i "/.\"Commercials\" :*./c\ \"Commercials\" : $commercial_libraries" github_download/both-dir/pseudo_config.py
|
sudo sed -i "/.\"Commercials\" :*./c\ \"Commercials\" : $commercial_libraries" github_download/both-dir/pseudo_config.py
|
||||||
@@ -250,6 +257,8 @@ if [ "$FIRST_INSTALL" == "true" ]
|
|||||||
sudo rm tv-libraries.temp
|
sudo rm tv-libraries.temp
|
||||||
sudo rm commercial-libraries.temp
|
sudo rm commercial-libraries.temp
|
||||||
sudo cp github_download/both-dir/pseudo_config.py ./
|
sudo cp github_download/both-dir/pseudo_config.py ./
|
||||||
|
sudo cp github_download/both-dir/PseudoChannel.py ./
|
||||||
|
cd ..
|
||||||
else
|
else
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
@@ -306,7 +315,7 @@ fi
|
|||||||
#### - Copy relevant files from github
|
#### - Copy relevant files from github
|
||||||
#### - Replace files originally removed
|
#### - Replace files originally removed
|
||||||
echo "Updating channels folder"
|
echo "Updating channels folder"
|
||||||
|
cd $dir
|
||||||
# Export critical files
|
# Export critical files
|
||||||
mkdir .pseudo-temp
|
mkdir .pseudo-temp
|
||||||
|
|
||||||
@@ -339,6 +348,7 @@ sudo chmod -R 777 .
|
|||||||
echo "Update Complete"
|
echo "Update Complete"
|
||||||
|
|
||||||
#### Write variables to config.cache
|
#### Write variables to config.cache
|
||||||
|
> config.cache
|
||||||
sudo sed -i "s/server_ip=.*/server_ip=$server_ip/" config.cache
|
sudo sed -i "s/server_ip=.*/server_ip=$server_ip/" config.cache
|
||||||
sudo sed -i "s/server_port=.*/server_port=$server_port/" config.cache
|
sudo sed -i "s/server_port=.*/server_port=$server_port/" config.cache
|
||||||
sudo sed -i "s/server_token=.*/server_token=$server_token/" config.cache
|
sudo sed -i "s/server_token=.*/server_token=$server_token/" config.cache
|
||||||
|
|||||||
Reference in New Issue
Block a user