timing rules

This commit is contained in:
fred 2023-01-05 16:28:10 +01:00
parent 8ed2d0389b
commit 704a0b71e0
4 changed files with 26 additions and 11 deletions

View File

@ -25,8 +25,8 @@ PORT=12345
mkdir -p ~/.zen/tmp/coucou/ ~/.zen/game/players/localhost mkdir -p ~/.zen/tmp/coucou/ ~/.zen/game/players/localhost
## CHECK FOR ANY ALREADY RUNNING nc ## CHECK FOR ANY ALREADY RUNNING nc
ncrunning=$(ps auxf --sort=+utime | grep -w 'nc -l -p 1234' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ncrunning=$(ps axf --sort=+utime | grep -w 'nc -l -p 1234' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
[[ $ncrunning ]] && echo "ERROR - API Server Already Running - ${myASTROPORT}/?salt=totodu56&pepper=totodu56&getipns " && exit 1 [[ $ncrunning ]] && echo "RESTARTING" && kill -9 $ncrunning
## NOT RUNNING TWICE ## NOT RUNNING TWICE
# Some client needs to respect that # Some client needs to respect that

View File

@ -213,7 +213,7 @@ else
echo '# TIDDLER WAS IN CACHE' echo '# TIDDLER WAS IN CACHE'
################################################################### ###################################################################
## TODO : ADD EMAIL TAG ( TIMESTAMP & ADD SIGNATURE over existing ones) ## TODO : ADD EMAIL TAG ( TIMESTAMP & ADD SIGNATURE over existing ones)
continue
fi fi
cp -f "${TIDDLER}" "$HOME/.zen/game/players/$PLAYER/G1CopierYoutube/" cp -f "${TIDDLER}" "$HOME/.zen/game/players/$PLAYER/G1CopierYoutube/"

View File

@ -42,19 +42,24 @@ PLAYER="$2"
CHOICE="$3" CHOICE="$3"
# Check who is .current PLAYER # Check who is .current PLAYER
[[ ${PLAYER} == "" ]] \ players=($(ls ~/.zen/game/players | grep -Ev "localhost" 2>/dev/null))
&& players=($(ls ~/.zen/game/players | grep -Ev "localhost" 2>/dev/null)) \
&& espeak "PLEASE CONNECT A PLAYER" \ [[ ${#players[@]} -ne 1 ]] \
&& OUTPUT=$(zenity --entry --width 640 --title="=> Astroport" --text="ASTRONAUTE ?" --entry-text=${players[@]}) \ && espeak "PLEASE CONNECT A PLAYER" && OUTPUT=$(zenity --entry --width 640 --title="=> Astroport" --text="ASTRONAUTE ?" --entry-text=${players[@]}) \
&& [[ $OUTPUT ]] && PLAYER=$OUTPUT && rm -f ~/.zen/game/players/.current && ln -s ~/.zen/game/players/$PLAYER ~/.zen/game/players/.current || OUTPUT="${players}"
echo "PLAYER = $OUTPUT"
[[ $OUTPUT ]] && ( PLAYER=$OUTPUT && rm -f ~/.zen/game/players/.current && ln -s ~/.zen/game/players/$PLAYER ~/.zen/game/players/.current ) \
|| espeak "NO PLAYER"
[[ ${PLAYER} == "" ]] \ [[ ${PLAYER} == "" ]] \
&& ${MY_PATH}/start.sh \ && ${MY_PATH}/start.sh \
&& espeak "Astronaut. Please enter pass phrase and email of your TW" \ && espeak "Astronaut. Please register." \
&& xdg-open "http://astroport.localhost:1234" \ && xdg-open "http://astroport.localhost:1234" \
&& exit 1 && exit 1
PSEUDO=$(myPlayerPseudo) PSEUDO=$(myPlayerUser)
espeak "Hello $PSEUDO" espeak "Hello $PSEUDO"
G1PUB=$(myPlayerG1Pub) G1PUB=$(myPlayerG1Pub)
@ -67,14 +72,22 @@ ASTRONAUTENS=$(myAstroKey)
BROWSER=$(xdg-settings get default-web-browser | cut -d '.' -f 1 | cut -d '-' -f 1) ## GET cookies-from-browser BROWSER=$(xdg-settings get default-web-browser | cut -d '.' -f 1 | cut -d '-' -f 1) ## GET cookies-from-browser
###
if [ $URL ]; then if [ $URL ]; then
echo "URL: $URL" echo "URL: $URL"
REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_" REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="${PLAYER} Type de media à importer ?" --entry-text="Video" Page MP3 Web) || IMPORT="$CHOICE" [ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="${PLAYER} Type de media à importer ?" --entry-text="Video" Page MP3 Web) || IMPORT="$CHOICE"
[[ $IMPORT == "" ]] && espeak "No choice made. Exiting program" && exit 1 [[ $IMPORT == "" ]] && espeak "No choice made. Exiting program" && exit 1
[[ $IMPORT == "Video" ]] && IMPORT="Youtube" [[ $IMPORT == "Video" ]] && IMPORT="Youtube"
CHOICE="$IMPORT" CHOICE="$IMPORT"
else
xdg-open "$myIPFS/ipns/$ASTRONAUTENS"
fi fi
###
( ## SUB PROCESS ( ## SUB PROCESS
# Get PLAYER wallet amount # Get PLAYER wallet amount
@ -82,13 +95,14 @@ fi
[[ $COINS == "" || $COINS == "null" ]] && espeak "Missing coins. Free Run." || espeak "You have $COINS Coins" [[ $COINS == "" || $COINS == "null" ]] && espeak "Missing coins. Free Run." || espeak "You have $COINS Coins"
) )
###
# GET SCREEN DIMENSIONS # GET SCREEN DIMENSIONS
screen=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') screen=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/')
width=$(echo $screen | cut -d 'x' -f 1) width=$(echo $screen | cut -d 'x' -f 1)
height=$(echo $screen | cut -d 'x' -f 2) height=$(echo $screen | cut -d 'x' -f 2)
large=$((width-300)) large=$((width-300))
haut=$((height-200)) haut=$((height-200))
###
######################################################################## ########################################################################
## CADRE EXCEPTION COPIE PRIVE ## CADRE EXCEPTION COPIE PRIVE
# https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/ # https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/

View File

@ -20,6 +20,7 @@ echo "(RE)STARTING 12345.sh"
|| ( killall "12345.sh"; killall "_12345.sh"; killall "nc" ) || ( killall "12345.sh"; killall "_12345.sh"; killall "nc" )
mkdir -p ~/.zen/tmp mkdir -p ~/.zen/tmp
~/.zen/Astroport.ONE/tools/displaytimer.sh 3
~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log & ~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log &
echo $! > ~/.zen/.pid echo $! > ~/.zen/.pid