Browse Source

ASTROPORT START if no ipfs daemon is running

master
fred 4 weeks ago
parent
commit
8db2ef9858
  1. 7
      ajouter_video.sh
  2. 4
      zen/cron_VRFY.sh

7
ajouter_video.sh

@ -87,6 +87,13 @@ case $? in
esac
fi
## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
[[ ! $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport/IPFS is OFF" --text="Activer Astroport ?" --entry-text="OUI" NON)
[[ $RUN == "" || $RUN == "NON" ]] && exit 1
## ACTIVATION ASTROPORT
[[ $RUN == "OUI" ]] && REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP"
########################################################################
# CHOOSE CATEGORY (remove anime, not working!)
[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre media" --entry-text="Film" Serie Youtube Video)

4
zen/cron_VRFY.sh

@ -34,6 +34,8 @@ if [[ ! $crontest ]]; then
# ADD cron_MINUTE.sh line
echo "* * * * * /bin/bash $MY_PATH/../cron_MINUTE.sh 2>&1>/dev/null" >> /tmp/newcron
crontab /tmp/newcron
sudo systemctl enable ipfs
sudo systemctl start ipfs
echo "ASTROPORT is ON"
else
## HEADER
@ -42,6 +44,8 @@ else
## REMOVE cron_MINUTE.sh line
cat /tmp/mycron | grep -Ev 'cron_MINUTE.sh' >> /tmp/newcron
crontab /tmp/newcron
sudo systemctl stop ipfs
sudo systemctl disable ipfs
echo "ASTROPORT is OFF"
fi

Loading…
Cancel
Save