-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version and root check #326
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,53 @@ | ||
#!/bin/bash | ||
command -v jq >/dev/null 2>&1 || { JQ=0; } | ||
#install python | ||
if ! command -v python3 &> /dev/null; then | ||
if [[ -e /etc/debian_version ]]; then | ||
sudo apt install python3 | ||
elif [[ -e /etc/fedora-release ]]; then | ||
sudo dnf install python3 | ||
elif [[ -e /etc/centos-release ]]; then | ||
sudo yum install -y python3 | ||
elif [[ -e /etc/arch-release ]]; then | ||
sudo pacman -Sy python3 | ||
else | ||
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, or Arch Linux system." | ||
exit 1 | ||
fi | ||
else | ||
echo "Skipping installing python, as python is preinstalled" | ||
fi | ||
#install tkinter, a dependency | ||
#install jq, needed to get version number | ||
if [[ -e /etc/debian_version ]]; then | ||
apt install python3 python3-tk | ||
sudo apt install python3-tk jq | ||
elif [[ -e /etc/fedora-release ]]; then | ||
dnf install python3 | ||
dnf install python3-tkinter | ||
sudo dnf install python3-tkinter jq | ||
elif [[ -e /etc/centos-release ]]; then | ||
yum install -y python3 | ||
yum install tkinter | ||
sudo yum install -y tkinter epel-release jq | ||
elif [[ -e /etc/arch-release ]]; then | ||
pacman -Sy python3 tk | ||
sudo pacman -Sy tk jq | ||
fi | ||
command -v pip >/dev/null 2>&1 || { curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py; python3 get-pip.py --no-warn-script-location; rm get-pip.py; } | ||
TAG=$(curl https://api.github.com/repos/ThioJoe/YT-Spammer-Purge/releases/latest -s | jq .name -r) | ||
if [[ $JQ -ne 0 ]]; then | ||
if [[ -e /etc/debian_version ]]; then | ||
apt purge jq | ||
elif [[ -e /etc/fedora-release ]]; then | ||
dnf remove jq | ||
elif [[ -e /etc/centos-release ]]; then | ||
yum remove jq epel-release | ||
elif [[ -e /etc/arch-release ]]; then | ||
pacman -Rs jq | ||
fi | ||
else | ||
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, Arch Linux system." | ||
exit 1 | ||
echo "Did not unistall jq as it was preinstalled before running this script." | ||
fi | ||
sudo -u $USER curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
sudo -u $USER python3 get-pip.py --no-warn-script-location | ||
# Uncomment if running this script alone, to also install the files for YT-Spammer-Purge | ||
: 'sudo -u $USER curl https://codeload.github.com/ThioJoe/YT-Spammer-Purge/tar.gz/refs/tags/v2.8.0 -o yt-spammer.tar.gz | ||
sudo -u $USER tar -xzf yt-spammer.tar.gz | ||
sudo -u $USER rm yt-spammer.tar.gz | ||
sudo -u $USER cd YT-Spammer-Purge-2.8.0/' | ||
sudo -u $USER rm get-pip.py | ||
sudo -u $USER pip -q install -r requirements.txt | ||
printf "Dependencies and Program installed!\nNow follow these instructions to get a client_secrets.json file!\nhttps://github.com/ThioJoe/YT-Spammer-Purge/wiki/Instructions:-Obtaining-an-API-Key\n" | ||
|
||
# Uncomment if running this script alone, to also install the files for Youtube-Spammer-Purge | ||
: 'curl https://codeload.github.com/ThioJoe/YT-Spammer-Purge/tar.gz/refs/tags/v${TAG} -o yt-spammer.tar.gz | ||
tar -xzf yt-spammer.tar.gz | ||
rm yt-spammer.tar.gz | ||
cd YouTube-Spammer-Purge-${TAG}/' | ||
bash -c "pip install -r requirements.txt" | ||
printf "Dependencies and Program installed!\nNow follow these instructions to get a client_secrets.json file!\nhttps://github.com/ThioJoe/YouTube-Spammer-Purge#instructions---obtaining-youtube-api-key\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,53 @@ | ||
#!/bin/bash | ||
#install python and tkinter, a dependency | ||
command -v jq >/dev/null 2>&1 || { JQ=0; } | ||
#install python | ||
if ! command -v python3 &> /dev/null; then | ||
if [[ -e /etc/debian_version ]]; then | ||
sudo apt install python3 | ||
elif [[ -e /etc/fedora-release ]]; then | ||
sudo dnf install python3 | ||
elif [[ -e /etc/centos-release ]]; then | ||
sudo yum install -y python3 | ||
elif [[ -e /etc/arch-release ]]; then | ||
sudo pacman -Sy python3 | ||
else | ||
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, or Arch Linux system." | ||
exit 1 | ||
fi | ||
else | ||
echo "Skipping installing python, as python is preinstalled" | ||
fi | ||
#install tkinter, a dependency | ||
#install jq, needed to get version number | ||
if [[ -e /etc/debian_version ]]; then | ||
apt install python3 python3-tk | ||
sudo apt install python3-tk jq | ||
elif [[ -e /etc/fedora-release ]]; then | ||
dnf install python3 | ||
dnf install python3-tkinter | ||
sudo dnf install python3-tkinter jq | ||
elif [[ -e /etc/centos-release ]]; then | ||
yum install -y python3 | ||
yum install tkinter | ||
sudo yum install -y tkinter epel-release jq | ||
elif [[ -e /etc/arch-release ]]; then | ||
pacman -Syu python3 tk | ||
sudo pacman -Sy tk jq | ||
fi | ||
command -v pip >/dev/null 2>&1 || { curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py; python3 get-pip.py --no-warn-script-location; rm get-pip.py; } | ||
TAG=$(curl https://api.github.com/repos/ThioJoe/YT-Spammer-Purge/releases/latest -s | jq .name -r) | ||
if [[ $JQ -ne 0 ]]; then | ||
if [[ -e /etc/debian_version ]]; then | ||
apt purge jq | ||
elif [[ -e /etc/fedora-release ]]; then | ||
dnf remove jq | ||
elif [[ -e /etc/centos-release ]]; then | ||
yum remove jq epel-release | ||
elif [[ -e /etc/arch-release ]]; then | ||
pacman -Rs jq | ||
fi | ||
else | ||
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, Arch Linux system." | ||
exit 1 | ||
echo "Did not unistall jq as it was preinstalled before running this script." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Did not uninstall jq..." |
||
fi | ||
sudo -u $USER curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
sudo -u $USER python3 get-pip.py | ||
# Uncomment if running this script alone, to also install the files for YT-Spammer-Purge | ||
sudo -u $USER curl https://codeload.github.com/ThioJoe/YT-Spammer-Purge/tar.gz/refs/tags/v2.8.0 -o yt-spammer.tar.gz | ||
sudo -u $USER tar -xzf yt-spammer.tar.gz | ||
sudo -u $USER rm yt-spammer.tar.gz | ||
sudo -u $USER cd YT-Spammer-Purge-2.8.0/ | ||
sudo -u $USER rm get-pip.py | ||
sudo -u $USER pip install -r requirements.txt | ||
printf "Dependencies and Program installed!\nNow follow these instructions to get a client_secrets.json file!\nhttps://github.com/ThioJoe/YT-Spammer-Purge/wiki/Instructions:-Obtaining-an-API-Key\n" | ||
|
||
# Uncomment if running this script alone, to also install the files for Youtube-Spammer-Purge | ||
curl https://codeload.github.com/ThioJoe/YT-Spammer-Purge/tar.gz/refs/tags/v${TAG} -o yt-spammer.tar.gz | ||
tar -xzf yt-spammer.tar.gz | ||
rm yt-spammer.tar.gz | ||
cd YouTube-Spammer-Purge-${TAG}/ | ||
bash -c "pip install -r requirements.txt" | ||
printf "Dependencies and Program installed!\nNow follow these instructions to get a client_secrets.json file!\nhttps://github.com/ThioJoe/YouTube-Spammer-Purge#instructions---obtaining-youtube-api-key\n" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Did not uninstall jq ..."