forked from axiom-team/astrXbian
ASTROPORT START if no ipfs daemon is running
This commit is contained in:
parent
ea3e841fea
commit
8db2ef9858
|
@ -87,6 +87,13 @@ case $? in
|
||||||
esac
|
esac
|
||||||
fi
|
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!)
|
# 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)
|
[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre media" --entry-text="Film" Serie Youtube Video)
|
||||||
|
|
|
@ -34,6 +34,8 @@ if [[ ! $crontest ]]; then
|
||||||
# ADD cron_MINUTE.sh line
|
# ADD cron_MINUTE.sh line
|
||||||
echo "* * * * * /bin/bash $MY_PATH/../cron_MINUTE.sh 2>&1>/dev/null" >> /tmp/newcron
|
echo "* * * * * /bin/bash $MY_PATH/../cron_MINUTE.sh 2>&1>/dev/null" >> /tmp/newcron
|
||||||
crontab /tmp/newcron
|
crontab /tmp/newcron
|
||||||
|
sudo systemctl enable ipfs
|
||||||
|
sudo systemctl start ipfs
|
||||||
echo "ASTROPORT is ON"
|
echo "ASTROPORT is ON"
|
||||||
else
|
else
|
||||||
## HEADER
|
## HEADER
|
||||||
|
@ -42,6 +44,8 @@ else
|
||||||
## REMOVE cron_MINUTE.sh line
|
## REMOVE cron_MINUTE.sh line
|
||||||
cat /tmp/mycron | grep -Ev 'cron_MINUTE.sh' >> /tmp/newcron
|
cat /tmp/mycron | grep -Ev 'cron_MINUTE.sh' >> /tmp/newcron
|
||||||
crontab /tmp/newcron
|
crontab /tmp/newcron
|
||||||
|
sudo systemctl stop ipfs
|
||||||
|
sudo systemctl disable ipfs
|
||||||
echo "ASTROPORT is OFF"
|
echo "ASTROPORT is OFF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue