Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/bash
- cd ./Setup_Fedora_Sections
- #Clean The Screen
- clear
- #Opening Section
- WELCOME=$(echo "Welcome to Setup Fedora: Optional Programs section written by Dustin T. Carr! This script is ment to be run whenever Fedora is newly installed as it contains the programs that are not neccessary for your system to run and be basically useful after a clean install.")
- echo $WELCOME
- echo $'\nDo you wish to continue? Y/N\n'
- while true; do
- read -p "" yn
- case $yn in
- [Yy]* ) echo ""
- break;;
- [Nn]* ) clear
- echo $WELCOME
- echo $'\nBye.'
- exit
- break;;
- * ) clear
- echo $WELCOME
- echo $'\nDo you wish to continue? Y/N\n';;
- esac
- done
- #Check if the system is already updated
- echo 'This script operates under the impression that you have an active internet connection.'
- TEST=$(ping -c 1 74.125.21.14|wc -l)
- if [ $TEST -gt 5 2>&1 ]
- then
- echo 'Time to update.'
- sudo dnf -y update
- #Step two: continue to installing the optional programs programs
- echo $'Now let\'s install the optional programs.'
- ./Optional_Programs/Optional_Programs_Install_Menue.sh
- exit
- else
- echo 'We have found that there is no active internet connection available. Wel will troubleshoot the issue.'
- #Check network card status
- WCARD_STATUS=$(ifconfig wlo1 | grep UP |wc -l)
- if [ $WCARD_STATUS = 1 ]
- then
- echo 'We found that your wireless card is active, checking internet connection.'
- TEST=$(ping -c 1 74.125.21.14|wc -l)
- if [ $TEST -gt 5 2>&1 ]
- then
- echo 'We found an active internet connection, the system will now update..'
- sudo dnf -y update
- #Step two: continue to installing the optional programs programs
- echo $'Now let\'s install the optional programs programs.'
- ./Optional_Programs/Optional_Programs_Install_Menue.sh
- exit
- else
- echo $'We cannot find an active internet connection. Please connect to the network then try again? Y/N\n'
- while true; do
- read -p "" yn
- case $yn in
- [Yy]* ) ./Setup_Fedora_Optional_Programs.sh
- exit
- break;;
- [Nn]* ) echo "Okay bye then."
- exit
- break;;
- * ) echo $'Please connect to the network then try again? Y/N\n'
- esac
- done
- fi
- else
- echo $'Your wireless card is inactive, do you wish to try run the install for it? Y/N\n'
- while true; do
- read -p "" yn
- case $yn in
- [Yy]* ) ./Setup_Fedora_Install_Wireless_Card.sh
- break;;
- [Nn]* ) break;;
- * ) echo $'\nDo you wish to try to run the install of your wireless card? Y/N\n';;
- esac
- done
- echo "Checking the status of your ethernet card."
- #Check if eno1 Network Card Is Available
- ECARD_STATUS=$(ifconfig eno1 | grep UP |wc -l)
- if [ $ECARD_STATUS = 1 ]
- then
- echo 'We found that your ethernet card is active, checking internet connection.'
- TEST=$(ping -c 1 74.125.21.14|wc -l)
- if [ $TEST -gt 5 2>&1 ]
- then
- echo 'We found an active internet connection, the system will now update..'
- sudo dnf -y update
- #Step two: continue to installing the optional programs programs
- echo $'Now let\'s install the optional programs programs.'
- ./Optional_Programs/Optional_Programs_Install_Menue.sh
- exit
- else
- echo $'We cannot find an active internet connection. Please connect to the network then try again? Y/N\n'
- while true; do
- read -p "" yn
- case $yn in
- [Yy]* ) ./Setup_Fedora_Optional_Programs.sh
- exit
- break;;
- [Nn]* ) echo "Okay bye then."
- exit
- break;;
- * ) echo $'Please connect to the network then try again? Y/N\n'
- esac
- done
- fi
- else
- echo $'We found that your ethernet card is also inactive, do you wish to try to run the install of your wireless card? Y/N\n'
- while true; do
- read -p "" yn
- case $yn in
- [Yy]* ) ./Setup_Fedora_Install_Wireless_Card.sh
- exit
- break;;
- [Nn]* ) echo $'\nBye.'
- exit
- break;;
- * ) echo $'\nDo you wish to try to run the install of your wireless card? Y/N\n';;
- esac
- done
- fi
- fi
- fi
- exit
Advertisement
Add Comment
Please, Sign In to add comment