A fake terminal for your school, friends for family.. Who don't know what they are doing.
#!/bin/bash
COMMANDS="
Commands Are: \n\t
ping: Send ICMP ECHO_REQUEST to network hosts.\n\t
nc: Arbitrary TCP and UDP connections and listens. (use to send text or a file to your friends)\n\t
request: To request a program or a real shell.\n\t
help or h: Echo this Help.\n\t
clear: Clear the display.\n\t
exit: Close this fake terminal.\n
"
echo -e $COMMANDS
while true
do
echo -ne "\033[1;33m`whoami`\033[1;37m@\033[1;32m`hostname`\033[1;37m:\033[1;31m (press h for help) \033[1;36m$ \033[0m"
read COMMAND
case "$COMMAND" in
ping )
read -p "What do you want to ping? " SERVER
ping -qc1 $SERVER
if [ $? -eq 1 ] ; then
echo "$SERVER is not avalible.. "
else
echo "$SERVER is avalible.. "
fi
;;
request )
read -p "What do you want to request? [program|shell] " REQUEST
case "$REQUEST" in
program )
;;
shell )
/bin/bash
;;
* )
echo "Can't request for $REQUEST.."
esac
;;
clear )
/usr/bin/clear
;;
exit )
exit
;;
help|h )
echo -e $COMMANDS
;;
* )
echo "$COMMAND: command not found "
esac
done
Give it a name:
mv whateveritwas [command.sh]
Make it work easer via:
chmod +x [command.sh]
Now you can use via:
[ ./command.sh ]
Comments