This repository has been archived on 2023-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
Pi-Hole-stats-tweeter/install.sh

33 lines
1.6 KiB
Bash
Raw Normal View History

2019-04-16 08:09:05 +02:00
#!/bin/sh
## pihole tweeter
2019-04-16 09:00:21 +02:00
NAMEOFAPP="Pi-hole Stats Tweeter"
WHATITDOES="This script will install Pi-Hole-stats-tweeter and setup a cronjob that runs every day at 23:55"
2019-04-16 08:09:05 +02:00
{ if
(whiptail --title "$NAMEOFAPP" --yes-button "Skip" --no-button "Proceed" --yesno "Do you want to setup $NAMEOFAPP? $WHATITDOES" 8 78)
then
echo "Declined $NAMEOFAPP"
else
2019-04-16 09:10:30 +02:00
sudo apt-get install -y python3-pip
2019-04-16 09:00:21 +02:00
pip3 install -U -r https://raw.githubusercontent.com/mwoolweaver/Pi-Hole-stats-tweeter/master/requirements.txt
2019-04-16 09:09:08 +02:00
wget https://raw.githubusercontent.com/mwoolweaver/Pi-Hole-stats-tweeter/master/pihole_tweeter.py -P ~/pihole_tweeter/
wget https://raw.githubusercontent.com/mwoolweaver/Pi-Hole-stats-tweeter/master/config.ini -P ~/pihole_tweeter/
2019-04-16 08:09:05 +02:00
CONSUMER_KEY=$(whiptail --inputbox "Consumer Key" 20 60 "" 3>&1 1>&2 2>&3)
CONSUMER_SECRET=$(whiptail --inputbox "Consumer Secret" 20 60 "" 3>&1 1>&2 2>&3)
ACCESS_TOKEN=$(whiptail --inputbox "Access Token" 20 60 "" 3>&1 1>&2 2>&3)
ACCESS_TOKEN_SECRET=$(whiptail --inputbox "Access Token Secret" 20 60 "" 3>&1 1>&2 2>&3)
2019-04-16 09:09:08 +02:00
sed -ie "s/VALUE1/$CONSUMER_KEY/" ~/pihole_tweeter/config.ini
sed -ie "s/VALUE2/$CONSUMER_SECRET/" ~/pihole_tweeter/config.ini
sed -ie "s/VALUE3/$ACCESS_TOKEN/" ~/pihole_tweeter/config.ini
sed -ie "s/VALUE4/$ACCESS_TOKEN_SECRET/" ~/pihole_tweeter/config.ini
2019-04-16 09:00:21 +02:00
fi }
{ if
(whiptail --title "$NAMEOFAPP" --yes-button "Skip" --no-button "Proceed" --yesno "Do you want to setup $NAMEOFAPP as a cronjob?" 8 78)
then
2019-04-23 12:23:06 +02:00
rm ~/pihole_tweeter/config.inie
2019-04-16 09:00:21 +02:00
echo "did not install cronjob"
else
sudo wget http://raw.githubusercontent.com/mwoolweaver/Pi-Hole-stats-tweeter/master/pi-hole-tweeter-cron -P /etc/cron.d/
2019-04-16 09:09:08 +02:00
rm ~/pihole_tweeter/config.inie
2019-04-16 08:09:05 +02:00
fi }