mirror of https://github.com/CIRCL/AIL-framework
Merge remote-tracking branch 'upstream/master'
commit
5bafc1fccc
|
@ -119,7 +119,7 @@ if __name__ == "__main__":
|
||||||
indexname = str(timestamp)
|
indexname = str(timestamp)
|
||||||
#update all_index
|
#update all_index
|
||||||
with open(indexRegister_path, "a") as f:
|
with open(indexRegister_path, "a") as f:
|
||||||
f.write(str(timestamp))
|
f.write('\n'+str(timestamp))
|
||||||
#create new dir
|
#create new dir
|
||||||
os.mkdir(indexpath)
|
os.mkdir(indexpath)
|
||||||
ix = create_in(indexpath, schema)
|
ix = create_in(indexpath, schema)
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
RED="\\033[1;31m"
|
||||||
|
DEFAULT="\\033[0;39m"
|
||||||
|
GREEN="\\033[1;32m"
|
||||||
|
|
||||||
|
[ -z "$AIL_HOME" ] && echo "Needs the env var AIL_HOME. Run the script from the virtual environment." && exit 1;
|
||||||
|
|
||||||
|
# Make sure the reseting is intentional
|
||||||
|
num=$(( ( RANDOM % 100 ) + 1 ))
|
||||||
|
|
||||||
|
echo -e $RED"To reset the platform, enter the following number: "$DEFAULT $num
|
||||||
|
read userInput
|
||||||
|
|
||||||
|
if [ $userInput -eq $num ]
|
||||||
|
then
|
||||||
|
echo "Reseting AIL..."
|
||||||
|
else
|
||||||
|
echo "Wrong number"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Kill all screens
|
||||||
|
screen -ls | grep Detached | cut -d. -f1 | awk '{print $1}' | xargs kill
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Access dirs and delete
|
||||||
|
cd $AIL_HOME
|
||||||
|
|
||||||
|
pushd dumps/
|
||||||
|
rm *
|
||||||
|
echo 'cleaned dumps'
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd indexdir/
|
||||||
|
rm -r *
|
||||||
|
echo 'cleaned indexdir'
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd LEVEL_DB_DATA/
|
||||||
|
rm -r *
|
||||||
|
echo 'cleaned LEVEL_DB_DATA'
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd logs/
|
||||||
|
rm *
|
||||||
|
echo 'cleaned logs'
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd PASTES/
|
||||||
|
rm -r *
|
||||||
|
echo 'cleaned PASTES'
|
||||||
|
popd
|
||||||
|
|
||||||
|
echo -e $GREEN"* AIL has been reset *"$DEFAULT
|
Loading…
Reference in New Issue