argon2 unused... using natools.py ... Adding shellcheck
This commit is contained in:
parent
a47a2a7416
commit
6fbd4e2730
|
@ -16,62 +16,62 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
ME="${0##*/}"
|
ME="${0##*/}"
|
||||||
###################################################################
|
###################################################################
|
||||||
### CREER VOTRE PROPRE VERSION DU JEU
|
### CREER VOTRE PROPRE VERSION DU JEU
|
||||||
### CHOISIR SCENARIO
|
### List games/E@MAIL/ directories
|
||||||
|
## PUT A PROPOSAL ON THE METHOD
|
||||||
## Most methods are breaking with games names containing SPACE !
|
|
||||||
GAMES=$(find "$GAMES_DIR" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
GAMES=$(find "$GAMES_DIR" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
||||||
GAMES=$(ls $MY_PATH/games/)
|
GAMES=$(ls $MY_PATH/games/)
|
||||||
GAMES=($(ls $MY_PATH/games/))
|
GAMES=($(ls -d $MY_PATH/games/))
|
||||||
|
# Above methods are breaking with games names containing SPACE !
|
||||||
|
|
||||||
## cd
|
## cd METHOD resist to " " space
|
||||||
cd games
|
cd games && GAMES=(".." *) && cd ..
|
||||||
GAMES=(".." *) #create table
|
## but can still be fooled...
|
||||||
cd - ## go back
|
|
||||||
|
|
||||||
select game in "${GAMES[@]}"; do
|
select game in "${GAMES[@]}"; do
|
||||||
|
|
||||||
|
# MY_GAME is the absolute path to selected game files
|
||||||
MY_GAME="$MY_PATH/games/$game"
|
MY_GAME="$MY_PATH/games/$game"
|
||||||
echo "SELECTION: "${MY_GAME}
|
echo "SELECTION: "${MY_GAME}
|
||||||
|
|
||||||
|
# test game start protocol compatibility
|
||||||
if [[ -x ${MY_GAME}/rooms/start.sh ]]; then
|
if [[ -x ${MY_GAME}/rooms/start.sh ]]; then
|
||||||
sleep 1
|
sleep 1
|
||||||
echo "Charging game..."
|
echo "Charging game..."
|
||||||
sleep 1
|
sleep 1
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
echo "ERROR - invalid game - choose another one - "
|
# not compatible
|
||||||
|
echo "ERROR - not compatible game - SELECT ANOTHER - "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# copy game files to user specific executable space
|
||||||
|
# $HOME/.zen/adventure/$newplayer
|
||||||
|
########################################
|
||||||
|
homefolder=$(pwd)
|
||||||
|
newplayer=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 10)
|
||||||
|
## Copy Player Game Files
|
||||||
|
mkdir -p $HOME/.zen/adventure/$newplayer
|
||||||
|
cp -r ${MY_GAME}/rooms $HOME/.zen/adventure/$newplayer/rooms
|
||||||
|
cp -r ${MY_GAME}/art $HOME/.zen/adventure/$newplayer/art
|
||||||
|
cp -r ${MY_GAME}/script $HOME/.zen/adventure/$newplayer/script
|
||||||
|
cp -r ${MY_GAME}/logic $HOME/.zen/adventure/$newplayer/logic
|
||||||
|
|
||||||
|
|
||||||
###################################################################
|
###################################################################
|
||||||
if hash uuidgen 2>/dev/null; then
|
echo "Loading... $newplayer/rooms/start.sh"
|
||||||
homefolder=$(pwd)
|
|
||||||
newplayer=$(uuidgen)
|
|
||||||
## Copy Player Game Files
|
|
||||||
mkdir -p $HOME/.zen/adventure/$newplayer
|
|
||||||
cp -r ${MY_GAME}/rooms $HOME/.zen/adventure/$newplayer/rooms
|
|
||||||
cp -r ${MY_GAME}/art $HOME/.zen/adventure/$newplayer/art
|
|
||||||
cp -r ${MY_GAME}/script $HOME/.zen/adventure/$newplayer/script
|
|
||||||
cp -r ${MY_GAME}/logic $HOME/.zen/adventure/$newplayer/logic
|
|
||||||
else
|
|
||||||
echo "missing uuidgen. EXIT"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
###################################################################
|
|
||||||
echo "Loading..."
|
|
||||||
echo
|
echo
|
||||||
sleep 2
|
sleep 2
|
||||||
###################################################################
|
###################################################################
|
||||||
if hash uuidgen 2>/dev/null; then
|
cd $HOME/.zen/adventure/$newplayer/rooms
|
||||||
cd $HOME/.zen/adventure/$newplayer/rooms
|
./start.sh
|
||||||
./start.sh
|
|
||||||
fi
|
|
||||||
###################################################################
|
###################################################################
|
||||||
# cleaning game files
|
# cleaning game files
|
||||||
if hash uuidgen 2>/dev/null; then
|
cd "$homefolder"
|
||||||
cd "$homefolder"
|
rm -r $HOME/.zen/adventure/$newplayer
|
||||||
rm -r $HOME/.zen/adventure/$newplayer
|
|
||||||
fi
|
|
||||||
echo "To continue..."
|
echo "To continue..."
|
||||||
exit
|
exit
|
||||||
|
|
|
@ -44,7 +44,7 @@ echo "#############################################"
|
||||||
echo "######### INSTALL BASE & PYTHON3 PACKAGE ####"
|
echo "######### INSTALL BASE & PYTHON3 PACKAGE ####"
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
|
|
||||||
for i in git make cmake docker-compose fail2ban npm argon2 netcat-traditional ncdu chromium* miller inotify-tools curl net-tools libsodium* libcurl4-openssl-dev python3-pip python3-setuptools python3-wheel python3-dotenv python3-gpg python3-jwcrypto python3-brotli python3-aiohttp mpack; do
|
for i in git make cmake docker-compose fail2ban npm shellcheck netcat-traditional ncdu chromium* miller inotify-tools curl net-tools libsodium* libcurl4-openssl-dev python3-pip python3-setuptools python3-wheel python3-dotenv python3-gpg python3-jwcrypto python3-brotli python3-aiohttp mpack; do
|
||||||
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||||
echo ">>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
|
echo ">>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
|
||||||
sudo apt install -y $i
|
sudo apt install -y $i
|
||||||
|
|
Loading…
Reference in New Issue