#!/bin/bash



green=`tput setaf 6`
yellow=`tput setaf 3`
red=`tput setaf 1`

time=`date +%H:%M:%S`
date=`date +%Y/%m/%d`



systemctl(){
	echo "(warning)$date-$time => User Enter systemctl command and I Answer " >> /tmp/myhoney.txt
	systemctl
}


iptables(){
	echo "(warning)$date-$time => User Enter iptables command and I Answer" >> /tmp/myhoney.txt
	echo "zsh: iptables permission denied"


}

wget(){
	echo "(warning)$date-$time => User Enter wget command and I Answer" >> /tmp/myhoney.txt
	echo "command wget Nothingt found ..."
}

cls(){
	echo "User Enter Command Clear" >> /tmp/myhoney.txt
	clear
}



os-release(){
	
	echo "$date-$time => User Enter cat /etc/os-release command and I Answer" >> /tmp/myhoney.txt
	cat Files/os-release
	
}

exitt(){
	echo "$date-$time => User Exited from app " >> /tmp/myhoney.txt
	exit 0
	echo "Connection to localhost closed."
}



# bin

bin(){

	#echo "============================= bin =================================="

	echo "$date-$time => User Enter to bin Directory " >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/bin# "
		read command
		echo "$date-$time => user Nothing in /bin Directory" >> /tmp/myhoney.txt
		chfilter=`echo $command | egrep -i '^chm'`
		catfilter=`echo "$command" | egrep -i '^cat'`
		if [ "$command" == "ls" ];then
			echo "$date-$time => User Enter ls command and I Answer" >> /tmp/myhoney.txt
			cat Files/bin.txt
		elif [ "$command" == "pwd" ];then
			echo "$date-$time => User Enter pwd command and I Answer" >> /tmp/myhoney.txt
			echo "/bin"
		elif [ "$chfilter" ];then
			echo "(warning) => $date-$time => User want to change permisions of Files in bin Directory" >> /tmp/myhoney.txt
			echo "chmod: Operation Nothingt permitted"
		elif [ "$catfilter" ];then
			echo "(warning) => $date-$time => => User Want to cat Files in bin Directory" >> /tmp/myhoney.txt
			echo "chmod: Operation Nothingt permitted"
		elif [ "$command" == "cd ../" ] || [ "$command" == "cd .." ];then
			while :
			do
				echo "$date-$time => User want to back main Directory" >> /tmp/myhoney.txt
				printf "[root@Archive_Server]/# "
				read comm
				if [ "$comm" ];then
					echo "zsh: $comm: command Nothingt found..."
				fi
			done
	
		elif [ "$command" == "exit" ];then
			exit 0
		else
			echo "$date-$time => I Answer command Not Found"
			echo "zsh: $command command Nothingt found ..."
		fi

	done
	echo "$date-$time => User Exited from /bin Directory" >> /tmp/myhoney.txt
	echo "===============================================================" >> /tmp/myhoney.txt
}





# boot

boot() {
    echo "============================= boot ============================" >> /tmp/myhoney.txt
    date=$(date +"%Y-%m-%d")
    time=$(date +"%H:%M:%S")
    echo "$date-$time => User Entered /boot Directory" >> /tmp/myhoney.txt

    while :; do
        printf "[root@Archive_Server]/boot# "
        read command

        case $command in
            ls)
                echo "config-5.16.14-200.fc35.x86_64"
                echo "efi"
                echo "elf-memtest86+-5.31"
                echo "extlinux"
                echo "grub2"
                echo "initramfs-0-rescue-52cb361b09db439c930c9aa9f83cbb33.img"
                echo "initramfs-5.16.13-200.fc35.x86_64.img"
                echo "initramfs-5.16.14-200.fc35.x86_64.img"
                echo "loader"
                echo "lost+found"
                echo "System.map-5.16.13-200.fc35.x86_64"
                echo "vmlinuz-0-rescue-52cb361b09db439c930c9aa9f83cbb33"
                echo "$date-$time => User executed 'ls' in /boot and response given" >> /tmp/myhoney.txt
                ;;
            pwd)
                echo "/boot"
                echo "$date-$time => User executed 'pwd' in /boot and response given" >> /tmp/myhoney.txt
                ;;
            "ls -ltrha")
                echo "-rw-------.  1 root root  81M Oct  4 01:24 initramfs-0-rescue-52cb361b09db439c930c9aa9f83cbb33.img"
                echo "drwx------.  4 root root 4.0K Jan  1  1970 efi"
                echo "drwxr-xr-x.  2 root root 3.0K Nov 17 23:52 extlinux"
                echo "-rw-------.  1 root root 5.7M Mar  9 02:38 System.map-5.16.13-200.fc35.x86_64"
                echo "-rw-r--r--.  1 root root 236K Mar  9 02:38 config-5.16.13-200.fc35.x86_64"
                echo "-rwxr-xr-x.  1 root root  11M Mar  9 02:38 vmlinuz-5.16.13-200.fc35.x86_64"
                echo "-rw-------.  1 root root 5.7M Mar 12 00:18 System.map-5.16.14-200.fc35.x86_64"
                echo "lrwxrwxrwx.  1 root root   47 Mar 18 13:14 symvers-5.16.14-200.fc35.x86_64.gz -> /lib/modules/5.16.14-200.fc35.x86_64/symvers.gz"
                echo "drwx------.  3 root root 1.0K Mar 19 23:36 grub2"
                echo "(warning) $date-$time => User executed 'ls -ltrha' in /boot and response given" >> /tmp/myhoney.txt
                ;;
            cd\ .. | cd\ ../)
                echo "$date-$time => User executed 'cd ..' and moving back to root" >> /tmp/myhoney.txt
                cd / # Change directory to root
                while :; do
                    printf "[root@Archive_Server]/# "
                    read comm
                    case $comm in
                        ls)
                            echo "bin   boot  etc  home  lib  lib64  lost+found  media  mnt  opt"
                            echo "proc  root  sbin  sys  usr"
                            echo "$date-$time => User executed 'ls' in / and response given" >> /tmp/myhoney.txt
                            ;;
                        pwd)
                            echo "/"
                            echo "$date-$time => User executed 'pwd' in / and response given" >> /tmp/myhoney.txt
                            ;;
                        *)
                            echo "zsh: $comm: command not found"
                            sleep 5
                            ;;
                    esac
                done
                ;;
            cd)
                echo "$date-$time => User executed 'cd' in /boot and remained in the same directory" >> /tmp/myhoney.txt
                printf "[root@Archive_Server]~# "
                read com
                [ "$com" ] && sleep 5
                ;;
            cat* | less* | vi* | xdg-open*)
                echo "(warning) $date-$time => User attempted to use '$command' in /boot, restricted action" >> /tmp/myhoney.txt
                echo "zsh: $command: command not allowed in /boot"
                ;;
            ls*)
                echo "(warning) $date-$time => User attempted 'ls' with additional options in /boot" >> /tmp/myhoney.txt
                sleep 5
                ;;
            exit)
                echo "$date-$time => User exited /boot Directory" >> /tmp/myhoney.txt
                echo "========================================================" >> /tmp/myhoney.txt
                break
                ;;
            *)
                echo "zsh: $command: command not found"
                ;;
        esac
    done
}


# dev

dev(){
	echo "============================== dev =================================" >> /tmp/myhoney.txt
	echo "$(date '+%Y-%m-%d %H:%M:%S') => User Entered /dev Directory" >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/dev# "
		read -r command

		# Handling ls command
		if [ "$command" == "ls" ]; then
			echo "$(date '+%Y-%m-%d %H:%M:%S') => User Entered 'ls' command in /dev Directory" >> /tmp/myhoney.txt
			ls /dev | grep -v 'ttyS3.*' && ls /dev | grep -v 'vcsa.*'

		# Handling pwd command
		elif [ "$command" == "pwd" ]; then
			echo "$(date '+%Y-%m-%d %H:%M:%S') => User Entered 'pwd' command and I Answered" >> /tmp/myhoney.txt
			echo "/dev"

		# Handling detailed ls command with options
		elif [ "$command" == "ls -ltrha" ]; then
			echo "(warning) $(date '+%Y-%m-%d %H:%M:%S') => User Entered 'ls -ltrha' command and I Answered" >> /tmp/myhoney.txt
			ls -ltrha /dev | grep -v 'ttyS3.*' && ls /dev | grep -v 'vcsa.*'

		# Handling exit command
		elif [ "$command" == "exit" ]; then
			echo "$(date '+%Y-%m-%d %H:%M:%S') => User Exited /dev Directory" >> /tmp/myhoney.txt
			echo "==============================================================" >> /tmp/myhoney.txt
			exit 0

		# Handling cd ../ command to go back to the parent directory
		elif [ "$command" == "cd ../" ] || [ "$command" == "cd .." ]; then
			echo "$(date '+%Y-%m-%d %H:%M:%S') => User Entered 'cd ..' to go back to / Directory" >> /tmp/myhoney.txt
			root

		# Handling attempts to navigate within /dev with 'cd' command
		elif [[ "$command" =~ ^cd\ .* ]]; then
			echo "$(date '+%Y-%m-%d %H:%M:%S') => User Attempted to Enter a Device Directory with 'cd' command - Permission Denied" >> /tmp/myhoney.txt
			echo "zsh: $command permissions denied"

		# Handling cd command with no arguments to go to home directory
		elif [ "$command" == "cd" ]; then
			echo "$(date '+%Y-%m-%d %H:%M:%S') => User Entered 'cd' command in /dev Directory, going to home directory" >> /tmp/myhoney.txt
			while :
			do
				printf "[root@Archive_Server]~# "
				read -r comm
				echo "$(date '+%Y-%m-%d %H:%M:%S') => User Entered command in home directory after cd" >> /tmp/myhoney.txt
				if [ "$comm" ]; then
					sleep 50
				fi
			done

		# Catch-all for any other commands
		else
			echo "$(date '+%Y-%m-%d %H:%M:%S') => User Entered an Unknown Command '$command' in /dev Directory - Command Not Found" >> /tmp/myhoney.txt
			echo "zsh: $command: command not found"
		fi

	done
}


etc(){
	echo "===============================================================" >> /tmp/myhoney.txt
	echo "$date-$time => User Enter to /etc Directory " >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_server]/etc# "
		read command
		if [ "$command" == "ls" ];then
			echo "$date-$time => user Enter ls Command and I answer" >> /tmp/myhoney.txt
			cat Files/etc

		samba_filter=`echo $command | grep samba`
		smb_conf_1=`echo $command | grep smb`
		smb_conf_2=`echo $command | grep cat`
		smb_conf_3=`echo $command | grep vi`
		elif [ "$samba_filter" ] || [ "$smb_conf_1" ] || [ "$smb_conf_2" ] || [ "$smb_conf_3" ];then
			echo "zsh: $comamnd permission denied"
			echo "(warning)$date-$time => User Enter command to see samba Service configs or ... and I Answer " >> /tmp/myhoney.txt
		elif [ "$command" == "pwd" ];then
			echo "$date-$time => user Enter pwd command and I answer" >> /tmp/myhoney.txt
			echo "/etc"
		filter1=`echo $command | grep "cat"`
		filter2=`echo $command | grep "less"`
		elif [ "$filter1" ] || [ "$filter2" ];then
			echo"(warning)$date-$time => zsh: $command permission enied ... " >> /tmp/myhoney.txt
		elif [ "$command" == "cd" ];then

			echo "$date-$time => user Enter cd in /etc Directory and and I answer" >> /tmp/myhoney.txt
			while :
			do
				printf "[root@Archive_server]# "
				read command
				if [ "$command" == "ls" ];then
					echo "$date-$time => user Enter pwd in root home and I answer" >> /tmp/myhoney.txt
					echo "koosha    lost+found"
				elif [ "$command" == "pwd" ];then
					echo "/root"
				elif [ "$command" == "cd /tmp" ] || [ "$command" == "cd /tmp/" ];then
					echo "$date-$time => user Enter cd /tmp command and I answer" >> /tmp/myhoney.txt
					tmp
				elif [ "$command" == "systemctl" ];then
					echo "(warning)$date-$time => user Enter systemctl command and I answer" >> /tmp/myhoney.txt
					systemctll
				elif [ "$command" == "clear" ];then
					echo "$date-$time => user Enter clear command and I answer" >> /tmp/myhoney.txt
					cls
				elif [ "$command" == "cd /etc" ] || [ "$command" == "cd /etc/" ];then
					echo "$date-$time => user Enter cd /etc command and I answer" >> /tmp/myhoney.txt
					etc

				else
					echo "zsh: command Nothingt found..."
				fi
			done
		else
			echo "zsh: command Nothingt found..."
		fi
	done
	echo "$date-$time => User Enter /etc Directory " >> /tmp/myhoney.txt
	echo "===========================================================" >> /tmp/myhoney.txt

}



# lib

lib(){
	echo "================================================================" >> /tmp/myhoney.txt
	echo "$date-$time => User Enter /lib Directory " >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/lib#"
		read command

		if [ "$command" == "ls" ];then
			echo "$date-$time => User Enter ls command in /lib Directory and I Answer " >> /tmp/myhoney.txt
			ls /lib | grep -v '^fed' | grep -v '.*release'

		elif [ "$command" == "pwd" ];then
			echo "$date-$time => user Enter pwd command and I Answer" >> /tmp/myhoney.txt
			echo "/lib"
		elif [ "$command" == "exit" ];then
			exit 0

		elif [ "$command" == "ls -ltrha" ];then
			echo "$date-$time => User Enter ls -ltrha command in /lib Directory and I Answer" >> /tmp/myhoney.txt
			ls -ltrha /lib | grep -v '^fed' | grep -v '.*release'
		elif [ "$command" == "systemctl" ];then
			echo "$date-$time => User Enter systemctl command in /lib Directory and I Answer" >> /tmp/myhoney.txt
			systemctl

		elif [ "$command" == "iptables" ];then
			iptables

		elif [ "$command" == "cd ../" ] || [ "$command" == "cd .." ];then
			echo "$date-$time => user Enter cd ../ command and I Answer" >> /tmp/myhoney.txt
			root
		elif [ "$command" == "cd" ];then
			echo "$date-$time => User Enter cd command and I Answer" >> /tmp/myhoney.txt
			while :
			do
				printf "[root@Archive_server]~# "
				read com
				if [ "$com" ];then
					sleep 50
				fi
			done

		fi

	done

	echo "$date-$time => User Exited /lib Directory " >> /tmp/myhoney.txt
	echo "============================================================" >> /tmp/myhoney.txt

}




lib64(){

	echo "===============================================================" >> /tmp/myhoney.txt
	echo "$date-$time => User Goes to lib64 Directory" >> /tmp/myhoney.txt	
	while :
	do
		printf "[root@Archive_Server]/lib64#"
		read command

		if [ "$command" == "ls" ];then
			echo "$date-$time => User Enter ls command in /lib64 Directory and I Answer " >> /tmp/myhoney.txt
			ls /lib64 | grep -v '^fed' | grep -v '.*release'

		elif [ "$command" == "pwd" ];then
			echo "$date-$time => user Enter pwd command and I Answer" >> /tmp/myhoney.txt
			echo "/lib64"

		elif [ "$command" == "ls -ltrha" ];then
			echo "$date-$time => User Enter ls -ltrha command in /lib64 Directory and I Answer" >> /tmp/myhoney.txt
			ls -ltrha /lib64 | grep -v '^fed' | grep -v '.*release'
		elif [ "$command" == "systemctl" ];then
			echo "$date-$time => User Enter systemctl command in /lib64 Directory and I Answer" >> /tmp/myhoney.txt
			systemctl

		elif [ "$command" == "iptables" ];then
			iptables

		elif [ "$command" == "cd ../" ] || [ "$command" == "cd .." ];then
			echo "$date-$time => user Enter cd ../ command and I Answer" >> /tmp/myhoney.txt
			root
		elif [ "$command" == "cd" ];then
			echo "$date-$time => User Enter cd command and I Answer" >> /tmp/myhoney.txt
			while :
			do
				printf "[root@Archive_server]~# "
				read com
				if [ "$com" ];then
					sleep 50
				fi
			done

		fi

	done

	echo "$date-$time => User Exited from lib64 Directory "
	echo "=============================================================" >> /tmp/myhoney.txt



}


media(){
	echo "=============================================================" >> /tmp/myhoney.txt
	echo "$date-$time => User Enter to /media directory" >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/media# "
		read command 

		if [ "$command" != "" ];then
			echo "$date-$time => User Enter $command and I have Nothing to Answer" >> /tmp/myhoney.txt
			true
		else
			true
		fi
	


	done
	echo "$date-$time => User Exited from media Directory " >> /tmp/myhoney.txt
	echo "==============================================================" >> /tmp/myhoney.txt


}

mnt(){
	echo " ============================= mnt =================================-"
	echo "$date-$time => User Enter to mnt Directory" >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/mnt# "
		read command 

		if [ "$command" != "" ];then
			echo "$date-$time => User Enter $command and have No Answer" >> /tmp/myhoney.txt
			true
		else
			true
		fi
	
	done
	echo "$date-$time =>User Exited from mnt directory" > /tmp/myhoney.txt

	echo "==================================================================" >> /tmp/myhoney.txt
}



# opt

opt(){
	echo "$date-$time => User Enter to /opt directory " >> /tmp/myhoney.txt
	echo "=============================================================================" >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/opt# "
		read command

		dashfilter=`echo $command | grep -i '^ls' | grep -i '-'`
		if [ "$command" == "ls" ];then
			echo "$date-$time => User Enter ls command and I Answer" >> /tmp/myhoney.txt
			echo -e "containerd\twebapp"

		elif [ "$command" == "pwd" ];then
			echo "/opt"
		elif [ "$dashfilter" ];then
			echo "(warning)$date-$time => User Enter ls command with - siwtches and I Answer" >> /tmp/myhoney.txt
			echo -e ".\t..\tcontainerd"
		elif [ "$command" == "cd .." ] ||  [ "$command" == "cd ../" ];then
			echo "$date-$time => User Enter cd .. command and return to root directory and I Answer" >> /tmp/myhoney.txt
			while :
			do
				echo "$date-$time => User Nothing in / directory in opt" >> /tmp/myhoney.txt 
				printf "[root@Archive_Server]/# "
				read com

## TODO:add root Simulator to This section

				if [ "$com" == "pwd" ];then
					echo "/"
				fi
			done

## TODO:add home_root Simultor to This section

		elif [ "$command" == "cd" ];then
			while :
			do
				echo "$date-$time => User Enetr cd command and I Answer and return to home of root User" >> /tmp/myhoney.txt
				printf "[root@Archive_Server]~# "
				read comm
				if [ "$comm" == "pwd" ];then
					echo "/root"
				elif [ "$comm" == "ls" ];then
					echo "$date-$time => User Enter ls command in home of root in opt directory and I Answer " >> /tmp/myhoney.txt
					true
				fi

			done
		fi		
	done
	echo "$date-$time => User Exited from /opt directory" >> /tmp/myhoney.txt
	echo "=============================================================================" >> /tmp/myhoney.txt
}

	


#proc

proc(){
	echo "$date-$time => User Enter proc Directory " >> /tmp/myhoney.txt
	echo "================================================================" >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/proc# "
		read command

		if [ "$command" == "ls" ];then
			echo "(warning)$date-$time => User Enter cd /proc command and I Answer " >> /tmp/myhoney.txt
			cat Files/proc

		elif [ "$command" == "pwd" ];then
			echo "/proc"
		elif [ "$command" == "cd ../" ] || [ "$command" == "cd .." ];then
			echo "$date-$time => User Enter cd .. command and goes to root directory and I Answer" >> /tmp/myhoney.txt
			while :
			do
				echo "$date-$time => User Now in root directory from /proc and Start" >> /tmp/myhoney.txt
				printf "root@Archive_Server]/# "
				read co

				lsfilter=`echo $comm | grep ls | grep '-'`
				if [ "$lsfilter" ];then
					echo "$date-$time => User Enter ls command with - switches and I Answer " >> /tmp/myhoney.txt
					sleep 50
				elif [ "$command" == "pwd" ];then
					echo "/"
				else
					true
				fi
			done


		elif [ "$command" == "cd" ];then
			while :
			do
				printf "[root@Archive_Server]~# "
				read co

				filterco=`echo $co | grep -i '^ls' | grep -i '-'`
				if [ "$filterco" ];then
					echo "$date-$time => User Enter ls command with - switch and I Answer" >> /tmp/myhoney.txt
					true
				elif [ "$co" == "pwd" ];then
					echo "pwd"
				else
					sleep 50
				fi
			done
		else
			echo "zsh: $command Nothingt found"
		fi
	done
	echo "$date-$time => User Exited from proc Directory " >> /tmp/myhoney.txt
	echo "=================================================================" >> /tmp/myhoney.txt
}


# run

run(){

	echo "=========================== run ===============================" >> /tmp/myhoney.txt
	echo "$date-$time => User Enter ro run Directory" >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/run# "
		read runcom


		lsfilter=`echo $runcom | grep -i '-'`
		cdfilter=`echo $runcom | grep -i 'cd'`

		if [ "$runcom" == "ls" ];then
			echo "$date-$time => User Enter ls command and I Answer" >> /tmp/myhoney.txt
			cat Files/run
		elif [ "$lsfilter" ];then
			echo "$date-$time => User Enter ls command with switched like - and I Answer" >> /tmp/myhoney.txt
			echo "zsh: $comamnd Nothingt found"

		elif [ "$runcom" == "pwd" ];then
			echo "/run"

		elif [ "$cdfilter" ];then
			echo "$date-$time => User Enter cd command in directory and I Answer" >> /tmp/myhoney.txt
			sleep 50
		fi
	done
	echo "$date-$time => User Exited From run Directory" >> /tmp/myhoney.txt
	echo "================================================================="
}



sbin(){
	echo "============================= sbin ===============================" >> /tmp/myhoney.txt
	echo "$date-$time => User Entered to sbin Directory" >> /tmp/myhoney.txt
	while :
	do

		lsfilter=`echo $command | grep -i 'ls'`
		dashfilter=`echo $command | grep -i '-'`
		cdfilter=`echo $command | grep -i 'cd'`
		chcommand=`echo $command | grep -i '^ch'`
		directfilter=`echo $command | grep -i ">"`
		printf "[root@Archive_Server]/sbin# "
		read command

		if [ "$command" == "pwd" ];then
			echo "/sbin"
		elif [ "$cdfilter" ];then
			echo "(warning)$date-$time => User want to change directory and I have No Answer" >> /tmp/myhoney.txt
			true
		elif [ "$lsfilter" ] && [ "$dashfilter" ];then
			echo "(warning)$date-$time => User Enter ls command with - switches and I Have No Answer" >> /tmp/myhoney.txt
			true
		elif [ "$dashfilter" ];then
			echo "(warning)$date-$time => User Enter command with - switches ans I have No Answer" >> /tmp/myhoney.txt
			true
		elif [ "$command" == "ls" ];then
			echo "$date-$time => User Enter ls command and I Answer" >> /tmp/myhoney.txt
			cat Files/sbin
		elif [ "$chcommand" ];then
			echo "(warning)$date-$time => User Enter chmod or chown command I Answer " >> /tmp/myhoney.txt
			echo "zsh: $command Operation Nothingt permitted"
		elif [ "$directfilter" ];then
			echo "(warning)$date-$time => User Enter redirect '>' and I Answer" >> /tmp/myhoney.txt
			echo "zsh : $command Operation Nothingt permitted"
		fi

	done
	echo "User Exited From sbin directory" >> /tmp/myhoney.txt
	echo "====================================================================" >> /tmp/myhoney.txt

}




srv(){
	echo "================================ srv ==================================" >> /tmp/myhoney.txt
	echo "$date-$time => User Entered to srv Directory" >> /tmp/myhoney.txt
	while :
	do

		printf "[root@fArchive_Server]/srv# "
		read command
		if [ "$command" ];then
			true
		fi
	done
	echo "$date-$time => User Exited from srv Directory" >> /tmp/myhoney.txt
	echo "=============================================================" >> /tmp/myhoney.txt
}




# sys

sys(){
	echo "======================== sys ========================== " >> /tmp/myhoney.txt
	echo "$date-$time => User Enter sys Directory " >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/sys# "
		read command

		dashfilter=`echo $command | grep -i '-'`
		if [ "$command" == "ls" ] && ! [ "$dashfilter" ] ;then
			echo "$date-$time => User Enter ls command without - and I Answer" >> /tmp/myhoney.txt
			echo -e "block\tclass\tdevice\tfs\t\tkernel\tpower"
			echo -e "bus\tdev\tfirmware\thypervisor\tmodule"
		
		elif [ "$command" == "pwd" ];then
			echo "/sys"
		elif [ "$command" == "cd ../" ] || [ "$command" == "cd .." ];then
			echo "$date-$time => User Enter cd .. command and I Answer" >> /tmp/myhoney.txt
			while :
			do
				printf "[root@Archive_Server]/# "
				read comm
				echo "User backed to home directory of root and type command and I go to sleep" >> /tmp/myhoney.txt
				if [ "$comm" ];then
					sleep 50
				fi

			done

		elif [ "$command" == "cd" ];then
			echo "$date-$time => User Enter cd command and I Answer" >> /tmp/myhoney.txt
			echo "zsh: $command permission denied"
		fi


	done
	echo "$date-$time => User Exit from sys Directory" >> /tmp/myhoney.txt
	echo "======================================================" >> /tmp/myhoney.txt
}




# User

user(){
	echo "========================= User ==============================" >> /tmp/myhoney.txt
	echo "$date-$time => User Enter user Directory" >> /tmp/myhoney.txt
	while :
	do
		printf "[root@Archive_Server]/usr# "
		read command

		cdfilter=`echo $command | grep -i 'cd'`

		if [ "$command" == "ls" ];then
			echo"bin\tinclude\tlib\tlib64\tlibexec\tlocal\tsbin\tshare\tsrc\ttmp"
		elif [ "$cdfilter" ];then
			true
		fi
	done
	echo "$date-$time => User Exited form user Directory" >> /tmp/myhoney.txt
	echo "=============================================================" >> /tmp/myhoney.txt
}




var(){
	echo "==================================== var ==================================" >> /tmp/myhoney.txt
	while :
	do
		echo "(warning)$date-$time => User Entered to /var Directory" >> /tmp/myhoney.txt
		printf "[root@Archive_Server]/var# "
		read command

		cdfilter=`echo $command | grep -i 'cd'`
		dashfilter=`echo $command | grep -i '-'`
		chfilter=`echo $command | grep -i '^ch'`
		if [ "$command" == "ls" ];then
			echo "$date-$time => User Enter ls command and I Answer" >> /tmp/myhoney.txt
			echo "account\tcrash\tftp\t\tlib\tlog\topt\t\tspool\typ"
			echo "adm\tdb\tlocal\tmail\tpreserve\ttmp"
			echo "cache\tempty\tkerberos\tlock\tnis\trun\twww"

		elif [ "$command" == "pwd" ];then
			echo "/var"

		elif [ "$cdfilter" ] || [ "$dashfilter" ];then
			echo "(warning)$date-$time => User want to Enter to directories or use switches with ls command and I have No Answer " >> /tmp/myhoney.txt
			true
		elif [ "$chfilter" ];then
			echo "(warning)$date-$time => User Enter chmod or chown command and I Answer" >> /tmp/myhoney.txt
			echo "zsh: Operation Nothingt permitted"
		fi

		done
	echo "$date-$time => User Exited From /var Directory" >> /tmp/myhoney.txt
	echo "================================================================" >> /tmp/myhoney.txt

}


tmp(){
	echo "==================================================================" >> /tmp/myhoney.txt
	while :
	do
		echo "$date-$time => User Entered to /tmp Directory" >> /tmp/myhoney.txt
		printf "[root@Archive_server]/tmp# "
		read command 

		dashfilter=`echo $command | grep -i '-'`
		chfilter=`echo $command | grep -i '^ch'`
		dashls=`echo $command | grep -i 'ls' | grep -i '-'`

		if [ "$command" == "ls" ];then
			echo "$date-$time => User Enter ls command and I Asnwer" >> /tmp/myhoney.txt
			echo "Temp-a5c3c07f-4822-4396-acbb-fcaff7ef6f4a"
			echo "systemd-private-39fda681e6b14467bdb5520c6d807542-upower.service-w3HzgX"
			echo "systemd-private-39fda681e6b14467bdb5520c6d807542-systemd-oomd.service-ItjQBw"
			echo "systemd-private-39fda681e6b14467bdb5520c6d807542-switcheroo-control.service-eE0w48"
			echo "systemd-private-39fda681e6b14467bdb5520c6d807542-bluetooth.service-NjOUC9"

		elif [ "$dashls" ];then
			echo "(warning)$date-$time => User Enter ls command with switches and I Answer" >> /tmp/myhoney.txt
			echo "zsh: $command Nothingt found"

		elif [ "$command" == "pwd" ];then
			echo "/tmp"
		elif [ "$command" == "cd /etc" ] || [ "$command" == "cd /etc/" ];then
			echo "(warning)$date-$time => User Enter cd /etc command and I Answer " >> /tmp/myhoney.txt
			etc
		else
			echo "zsh: command Nothingt found..."
		fi
		echo "$date-$time => User Exit From /tmp Directory" >> /tmp/myhoney.txt
	done
	echo "====================================================================" >> /tmp/myhoney.txt
}





root(){
	while :
	do
		printf "[root@Archive_Server]/# "
		read command 
		if [ "$command" == "ls" ];then
			echo "$date-$time => User Enter ls command in bin Directory and I Answer " >> /tmp/myhoney.txt
			echo "bin    boot    dev    etc    home    lib"
			echo "lib64    lost+found    media    mnt    opt"
			echo "proc    root    run    run    sbin"
			echo "srv    sys    tmp    usr    var"

		elif [ "$command" == "ls -ltrha" ] || [ "$command" == "ls -l" ] || [ "$command" == "ls -lt" ] || [ "$command" == "ls -la" ];then
			echo -e "total 0"
			echo -e "drwxr-xr-x   1 root root    0 Mar 15  2022 selinux"
			echo -e "drwxr-xr-x   1 root root    0 Mar 15  2022 mnt"
			echo -e "drwxr-xr-x   1 root root   12 Mar 15  2022 home"
			echo -e "drwxr-xr-x   1 root root  110 Mar 15  2022 usr"
			echo -e "drwxr-xr-x   1 root root  156 Jan 21 18:08 .."
			echo -e "drwxr-xr-x   1 root root  156 Jan 21 18:08 ."
			echo -e "drwxr-xr-x   1 root root   84 Jan 21 21:23 lib"
			echo -e "drwxr-xr-x   1 root root  110 Jan 21 21:30 var"
			echo -e "drwxr-xr-x   1 root root 3.0K Jan 21 21:32 lib64"
			echo -e "drwxr-xr-x   1 root root 1.3K Jan 21 21:38 boot"
			echo -e "drwxr-xr-x   1 root root   28 Jan 21 22:18 srv"
			echo -e "drwxr-xr-x   1 root root 3.9K Jan 21 23:33 sbin"
			echo -e "drwxr-xr-x   1 root root 1.8K Jan 21 23:33 bin"
			echo -e "drwx------   1 root root  138 Jan 23 18:51 root"
			echo -e "drwxr-xr-x   1 root root   32 Jan 24 22:21 opt"
			echo -e "drwxr-xr-x   1 root root 5.3K Jan 25 15:21 etc"
			echo -e "dr-xr-xr-x 230 root root    0 Jan 28 07:20 proc"
			echo -e "dr-xr-xr-x  13 root root    0 Jan 28 07:20 sys"
			echo -e "drwxr-xr-x  20 root root 4.3K Jan 28 07:21 dev"
			echo -e "drwxr-x---   1 root root  110 Jan 28 07:31 .snapshots"
			echo -e "drwxr-xr-x  41 root root 1.1K Jan 28 10:49 run"
			echo -e "drwxrwxrwt   1 root root 1.4K Jan 28 11:02 tmp"
		elif [ "$command" == "pwd" ];then
			echo "$date-$time => User Enter pwd command and I Answer" >> /tmp/myhoney.txt
			echo "/"
		elif [ "$command" == "cd bin" ] || [ "$command" == "cd bin/" ];then

			echo "(warning)$date-$time => User Enter cd bin and I Answer" >> /tmp/myhoney.txt
			bin
		elif [ "$command" == "cd boot" ] || [ "$command" == "cd boot/" ];then

			echo "(warning)$date-$time => User Enter cd boot and I Answer" >> /tmp/myhoney.txt
			boot
		elif [ "$command" == "cd dev" ] || [ "$command" == "cd dev/" ];then
			echo "(warning)$date-$time => User Enter cd dev and I Answer" >> /tmp/myhoney.txt
			dev
		elif [ "$command" == "cd etc" ] || [ "$command" == "cd etc/" ];then
			echo "(warning)$date-$time => User Enter cd etc and I Answer" >> /tmp/myhoney.txt
			etc
		elif [ "$command" == "cd home" ] || [ "$command" == "cd home/" ];then
			echo "(warning)$date-$time => User Enter cd home and I Answer" >> /tmp/myhoney.txt
			home
		elif [ "$command" == "cd lib" ] || [ "$command" == "cd lib/" ];then
			echo "(warning)$date-$time => User Enter cd lib and I Answer" >> /tmp/myhoney.txt
			lib
		elif [ "$command" == "cd lib64" ] || [ "$command" == "cd lib64/" ];then
			echo "(warning)$date-$time => User Enter cd lib64 and I Answer" >> /tmp/myhoney.txt
			lib64
		elif [ "$command" == "cd list+found" ] || [ "$command" == "cd lost+found/" ];then
			echo "(warning)$date-$time => User Enter cd lost+found and I Answer" >> /tmp/myhoney.txt
			true
		elif [ "$command" == "cd media" ] || [ "$command" == "cd media/" ];then
			echo "(warning)$date-$time => User Enter cd media and I Answer" >> /tmp/myhoney.txt
			media
		elif [ "$command" == "cd mnt" ] || [ "$command" == "cd mnt/" ];then
			echo "(warning)$date-$time => User Enter cd mnt and I Answer" >> /tmp/myhoney.txt
			mnt
		elif [ "$command" == "cd opt" ] || [ "$command" == "cd opt/" ];then
			echo "(warning)$date-$time => User Enter cd opt and I Answer" >> /tmp/myhoney.txt
			opt
		elif [ "$command" == "cd proc" ] || [ "$command" == "cd proc/" ];then
			echo "(warning)$date-$time => User Enter cd proc and I Answer" >> /tmp/myhoney.txt
			proc
		elif [ "$command" == "cd root" ] || [ "$command" == "cd root/" ];then
			echo "(warning)$date-$time => User Enter cd root and I Answer" >> /tmp/myhoney.txt
			root
		elif [ "$command" == "cd run" ] || [ "$command" == "cd run/" ];then
			echo "(warning)$date-$time => User Enter cd run and I Answer" >> /tmp/myhoney.txt
			run
		elif [ "$command" == "cd sbin" ] || [ "$command" == "cd sbin/" ];then
			echo "(warning)$date-$time => User Enter cd sbin and I Answer" >> /tmp/myhoney.txt
			sbin
		elif [ "$command" == "cd srv" ] || [ "$command" == "cd srv/" ];then
			echo "(warning)$date-$time => User Enter cd srv and I Answer" >> /tmp/myhoney.txt
			srv
		elif [ "$command" == "cd sys" ] || [ "$command" == "cd sys/" ];then
			echo "(warning)$date-$time => User Enter cd sys and I Answer" >> /tmp/myhoney.txt
			sys
		elif [ "$command" == "cd tmp" ] || [ "$command" == "cd tmp/" ];then
			echo "(warning)$date-$time => User Enter cd tmp and I Answer" >> /tmp/myhoney.txt
			tmp
		elif [ "$command" == "cd usr" ] || [ "$command" == "cd usr/" ];then
			echo "(warning)$date-$time => User Enter cd usr and I Answer" >> /tmp/myhoney.txt
			usr
		elif [ "$command" == "cd var" ] || [ "$command" == "cd var/" ];then
			echo "(warning)$date-$time => User Enter cd var and I Answer" >> /tmp/myhoney.txt
			var

		elif [ "$command" == "exit" ];then
			exit 0
		
		else
			echo "zsh:command Nothingt found ..."
		fi

	done

	}




ls_home(){

	echo -e ".bash_history\t.dbus\t.local\t.viminfo\thome\n"
	echo -e ".cach\t.gnupg\t.mysql_histoty\tbin\n"
	echo -e "Documents\tDownloads"


}




home_root(){
	while :
	do
		printf "[root@Archive_Server]~# "
		read command
		if [ "$command" == "ls" ];then
			echo ".ansible       .config  .gnupg    .mysql_history  .vim       bin
.bash_history  .dbus    .lesshst  .npm            .viminfo   inst-sys
.cache         .docker  .local    .ssh            .vmodules"
		elif [ "$command" == "pwd" ];then
			echo "/root"
		elif [ "$command" == "cd" ];then
			home_root
		elif [ "$command" == "cd .." ];then
			root
		ssh_filter=`echo $command | grep "sshd"`
		elif [ "$ssh_filter" ];then
			echo "(warning)$date-$time => User Enter command to Edit or see ssh configs and commands" >> /tmp/myhoney.txt
			echo "zsh: $command permission denied"
		mysql_filter=`echo $command | grep mysql`
		mariabdv_filter=`echo $command | grep mariadb`
		elif [ "$mysql_filter" ] || [ "$mariadb_filter" ];then
			echo "(warning)$date-$time => User Enter mysql or mariadb command and I Answer" >> /tmp/myhoney.txt
			echo "zsh: $command permission denied"
		
		elif [ "$command" == "cat /etc/passwd" ];then
			echo "(warning)$date-$time => User Enter cat /etc/passwdcommand and I Answer" >> /tmp/myhoney.txt
			cat Files/passwd
		elif [ "$command" == "ls -ltrha" ];then
			echo "(warning)$date-$time => User Enter ls -ltrha command and I Answer" >> /tmp/myhoney.txt
			echo "-rw-r--r--.  1 root root  129 ژوئیه   23  2021 .tcshrc"
			echo "-rw-r--r--.  1 root root  100 ژوئیه   23  2021 .cshrc "
			echo "rw-r--r--.  1 root root  141 ژوئیه   23  2021 .bash_profile"
			echo "-rw-r--r--.  1 root root  429 ژوئیه   23  2021 .bashrc  
			echo "-rw-r--r--.  1 root root  141 ژوئیه   23  2021 .bash_profile
			echo "-rw-r--r--.  1 root root   18 ژوئیه   23  2021 .bash_logout"
			echo "-rw-------.  1 root root 1.8K اكتبر   12 13:25 .mysql_history"
			echo "-rw-------.  1 root root   50 اكتبر   18 14:57 .xauthpFAYMd"
			echo "drwx------.  2 root root 4.0K ژانویه  14 17:56 .ecryptfs"
			echo "drwx------.  2 root root 4.0K فوریه    5 01:11 .ssh"                                 
			echo "drwx------.  3 root root 4.0K فوریه   14 16:50 .dbus"                                
			echo "drwx------.  4 root root 4.0K فوریه   14 16:50 .config"                              
			echo "drwx------.  3 root root 4.0K فوریه   14 16:50 .local "                              
			echo "dr-xr-xr-x. 19 root root 4.0K مارس     5 04:46 .."                                   
			echo "drwx------. 10 root root 4.0K مارس     8 17:44 .cache"                               
			echo "-rw-------.  1 root root   20 مارس    13 13:11 .lesshst"                             
			echo "-rw-------.  1 root root  13K مارس    18 00:20 .viminfo"                             
			echo "dr-xr-x---. 11 root root 4.0K مارس    18 15:37 .   "
		elif [ "$command" == "clear" ];then
			clear
		elif [ "$command" == "cd /etc" ] || [ "$command" == "cd /etc/" ];then
			etc
		elif [ "$command" == "cd /" ];then
			root
		elif [ "$command" == "cd /bin" ] || [ "$command" == "cd /bin/" ];then
			bin
		elif [ "$command" == "cd /boot" ] || [ "$command" == "cd /boot/" ];then
			boot
		elif [ "$command" == "cd /dev" ] || [ "$command" == "cd /dev/" ];then
			dev
		elif [ "$command" == "cd /home" ] || [ "$command" == "cd /home/" ];then
			home
		elif [ "$command" == "cd /lib" ] || [ "$command" == "cd /lib/" ];then
			lib
		elif [ "$command" == "cd /lib64" ] || [ "$command" == "cd /lib64/" ];then
			lib64

		elif [ "$command" == "cd /media" ] || [ "$command" == "cd /media/" ];then
			media
		elif [ "$command" == "cd /mnt" ] || [ "$command" == "cd /mnt/" ];then
			mnt
		elif [ "$command" == "cd /opt" ] || [ "$command" == "cd /opt/" ];then
			opt
		elif [ "$command" == "cd /proc" ] || [ "$command" == "cd /proc/" ];then
			proc
		elif [ "$command" == "cd /run" ] || [ "$command" == "cd /run/" ];then
			run
		elif [ "$command" == "cd /root" ] || [ "$command" == "cd /root/" ];then
			root
		elif [ "$command" == "cd /run" ] || [ "$command" == "cd /run/" ];then
			run
		elif [ "$command" == "cd /sbin" ] || [ "$command" == "cd /sbin/" ];then
			sbin
		elif [ "$command" == "cd /srv" ] || [ "$command" == "cd /srv/" ];then
			srv
		elif [ "$command" == "cd /sys" ] || [ "$command" == "cd /sys/" ];then
			sys

		elif [ "$command" == "cd /tmp" ] || [ "$command" == "cd /tmp/" ];then
			tmp

		elif [ "$command" == "cd /usr" ] || [ "$command" == "cd /user/" ];then
			user

		elif [ "$command" == "cd /var" ] || [ "$command" == "cd /var/" ];then
			var
		elif [ "$command" == "exit" ];then
			exit 0
		else 
			echo "zsh: $command command Nothing found ..."
		fi
	done


}

# Login
lient_ip=`pinky | grep 'pts/6' | awk {'print $7'}`
while :
do

	printf "root@Archive_Server's password: "
	read password
	if [ "$password" == "admin" ];then
		echo "$date-$time => Logined to Server with admin password" >> /tmp/myhoney.txt
		echo "Welcome to Archive_Server"
		echo "Last login: Fri Mar 18 14:40:25 2022 from $client_ip"
		sleep 2
		home_root
	else 
		touch /tmp/myhoney.txt
		echo "(warning) $date-$time => User Enter $password and I answer permission denied " >> /tmp/myhoney.txt
		echo "Permission denied, please try again."
	fi

done



