// HOWTO PASS FILTER Query parameter to bash exec ?

This commit is contained in:
fred 2021-09-04 01:43:25 +02:00
parent 8d097d7a0c
commit dbec0e3c15
2 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ require_once('functions.php');
$videosList = array();
// HOWTO PASS Query parameters to exec ?
exec("/bin/bash -c './get_astrxbian_index.sh F'", $videos);
exec("/bin/bash -c './check_my_wallet.sh'", $gg1);

View File

@ -5,8 +5,10 @@
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
PREFIX="$1"
FILTER="$2"
[[ $PREFIX == "" ]] && PREFIX="Y"
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
# Filter no ipns link
cat /home/$YOU/.zen/{ipfs,ipfs_swarm}/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | sort | uniq | tail -n +2
[[ ! $FILTER ]] && cat /home/$YOU/.zen/{ipfs,ipfs_swarm}/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | sort | uniq | tail -n +2 && exit 0
cat /home/$YOU/.zen/{ipfs,ipfs_swarm}/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | grep "$FILTER" | sort | uniq | tail -n +2