astrXbian_UX-et-webUI/www/boris/get_astrxbian_index.sh

15 lines
796 B
Bash
Raw Normal View History

2021-08-10 02:06:59 +02:00
#!/bin/bash
########################################################################
# Author:
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
PREFIX="$1"
FILTER="$2"
[[ $PREFIX == "" ]] && PREFIX="*"
2021-08-10 02:06:59 +02:00
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
[[ ! $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