Created
April 1, 2020 04:40
-
-
Save umamiMike/6ecefe92019a48d66d0f630139c419cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# fun script I made in an hour to play with demoing various commands. | |
# Should be filed under stupid-bash-tricks | |
clear | |
echoEval () { | |
echo -e " =========================================" | |
cmd=$* | |
echo -e "Evaluation the command :\n \t\t $cmd \n ==============================" | |
eval $cmd | |
echo -e " =========================================" | |
readContinue | |
} | |
echoPause () { | |
echo -e " =========================================" | |
cmd=$* | |
echo -e "\n \t $cmd \n " | |
echo -e " =========================================" | |
readContinue | |
} | |
readContinue () { | |
echo -e "\n\n" | |
read -n 1 -r -s -p $'Press enter to continue...\n' | |
clear | |
} | |
echoPause "ifconfig is aifconfig is a command line interface tool for network interface configuration and also used to initialize an interfaces at system boot time. Once a server is up and running, it can be used to assign an IP Address to an interface and enable or disable the interface on " | |
echoEval "ifconfig" | |
echoPause "to list all interfaces up or down use the -a flag" | |
echoEval "ifconfig -a" | |
echoEval "ls -la" | |
echoPause " To assign an IP address to an interface, use the following command." | |
echoPause "$ sudo ifconfig eth0 192.168.56.5 netmask 255.255.255.0 " | |
echoPause "To activate an network interface, type." | |
echoPause "$ sudo ifconfig up eth0" | |
echoPause "To deactivate or shut down an network interface, type." | |
echoPause "$ sudo ifconfig down eth0" | |
echoPause "Note: Although ifconfig is a great tool, it is now obsolete (deprecated), its replacement is ip command which is explained below." | |
echo "the end." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment