Skip to content

Commit

Permalink
linux.sh setup file added
Browse files Browse the repository at this point in the history
  • Loading branch information
MehmetYukselSekeroglu committed May 26, 2024
1 parent 26d0115 commit 457463b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
8 changes: 4 additions & 4 deletions hivelibrary/consolePrint.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ def _GetTime():

# BILGILENDIRMELER ICIN
def p_info(mesages:str, locations:str=None):
sys.stdout.write(f"{C_GREEN}[{_GetTime()}]{T_BOLD}[INFO]: {T_BOLD_RESET}{mesages}\n")
sys.stdout.write(f"{C_GREEN}[{_GetTime()}]{T_BOLD} [INFO]: {T_BOLD_RESET}{mesages}\n")
sys.stdout.flush()

# HATA MESAJLARI ICIN
def p_error(mesages:str,locations:str=None):
sys.stderr.write(f"{C_RED}[{_GetTime()}]{T_BOLD}[ERR]: {T_BOLD_RESET}{mesages}\n")
sys.stderr.write(f"{C_RED}[{_GetTime()}]{T_BOLD} [ERR]: {T_BOLD_RESET}{mesages}\n")
sys.stdout.flush()

# Uyarıları için
def p_warn(mesages:str,locations:str=None):
print(f"{C_ORANGE}[{_GetTime()}]{T_BOLD}[WARN]: {T_BOLD_RESET}{mesages}")
print(f"{C_ORANGE}[{_GetTime()}]{T_BOLD} [WARN]: {T_BOLD_RESET}{mesages}")

#Log mesajları için
def p_log(mesages:str,locations:str=None):
print(f"{C_BLUE}[{_GetTime()}][log]: {mesages}")
print(f"{C_BLUE}[{_GetTime()}] [LOG]: {mesages}")

def p_title(your_title:str,locations:str=None):

Expand Down
2 changes: 2 additions & 0 deletions hivelibrary/install_insightface_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import insightface
app = insightface.app.FaceAnalysis()
34 changes: 32 additions & 2 deletions linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ check_reqiered_commands(){
p_info "CHECKING REQUIRED PACKAGETS"
printf "\n"

check_command "nohup"
check_command "docker"
check_command "jq"
check_command "docker"
check_command "python3"
check_command "pip3"
check_command "sudo"
check_command "cat"
check_command "make"
check_command "cmake"
Expand Down Expand Up @@ -245,6 +244,37 @@ elif [[ "$1" == "--stop-container" ]]; then
p_info "Container Successfully stopped:\t$container_name!"
exit 0

# stop container for user
elif [[ "$1" == "--start-container" ]]; then
printf "\n"
printf "$blue<-[ Starting Docker Container ]->\n$reset"
printf "\n"
sleep 1

docker start $container_name

if [[ "$?" != "0" ]]; then
p_error "Failed to start docker container:\t$container_name !"
exit 1

else
p_info "OK..."

fi

printf "\n"
p_info "Container Successfully start:\t$container_name!"
exit 0


# stop container for user
elif [[ "$1" == "--start-hive" ]]; then
printf "\n"
printf "$blue<-[ Starting TheHive ]->\n$reset"
printf "\n"
sleep 1

python3 main.py


# romove/delete container
Expand Down

0 comments on commit 457463b

Please sign in to comment.