Files
EmpireProject-EmPyre/setup/reset.sh
T
Alexander Rymdeko-Harvey 74cbff7f52 Check if user is running as root
2016-03-21 15:59:00 -04:00

32 lines
477 B
Bash
Executable File

#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "[!]This script must be run as root" 1>&2
exit 1
fi
IFS='/' read -a array <<< pwd
if [[ "$(pwd)" != *setup ]]
then
cd ./setup
fi
# reset the database
rm ../data/empyre.db
./setup_database.py
cd ..
# Support non-root instalation of DB
chown $(logname):$(logname) ./data/empyre.db
# remove the debug file if it exists
rm empyre.debug
# remove the download folders
rm -rf ./downloads/
# start up EmPyre
./empyre --debug