mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Improving install and uninstall scripts
This commit is contained in:
parent
7bddda933a
commit
d333b5bcf3
10
README.md
10
README.md
@ -101,17 +101,11 @@ Quick search that grabs relevant information about a movie
|
|||||||
|
|
||||||
* Then cd into the cloned directory: ```cd Bash-Snippets```
|
* Then cd into the cloned directory: ```cd Bash-Snippets```
|
||||||
|
|
||||||
#### To install all scripts
|
* Run the guided install script with
|
||||||
```bash
|
```bash
|
||||||
./install.sh
|
./install.sh
|
||||||
```
|
```
|
||||||
|
this will let you choose which scripts to install
|
||||||
#### To install individual scripts
|
|
||||||
Ex. Weather
|
|
||||||
```bash
|
|
||||||
cd weather
|
|
||||||
./install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Uninstalling
|
## Uninstalling
|
||||||
|
|
||||||
|
92
install.sh
92
install.sh
@ -1,16 +1,80 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# Author: Alexander Epstein https://github.com/alexanderepstein
|
||||||
cd currency || exit 1
|
currentVersion="1.0.0"
|
||||||
./install.sh || exit 1
|
|
||||||
cd .. || exit 1
|
if [[ $# == 0 ]]; then
|
||||||
cd stocks || exit 1
|
|
||||||
./install.sh
|
echo -n "Do you wish to install currency [Y/n]: "
|
||||||
cd .. || exit 1
|
read -r answer
|
||||||
cd weather || exit 1
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
./install.sh
|
cd currency || exit 1
|
||||||
cd .. || exit 1
|
./install.sh || exit 1
|
||||||
cd crypt || exit 1
|
cd .. || exit 1
|
||||||
./install.sh
|
fi
|
||||||
cd .. || exit 1
|
|
||||||
cd movies || exit 1
|
unset answer
|
||||||
./install.sh
|
echo -n "Do you wish to install stocks [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd stocks || exit 1
|
||||||
|
./install.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset answer
|
||||||
|
echo -n "Do you wish to install weather [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd weather || exit 1
|
||||||
|
./install.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset answer
|
||||||
|
echo -n "Do you wish to install crypt [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd crypt || exit 1
|
||||||
|
./install.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset answer
|
||||||
|
echo -n "Do you wish to install movies [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd movies || exit 1
|
||||||
|
./install.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == "currency" ]];then
|
||||||
|
cd currency || exit 1
|
||||||
|
./install.sh || exit 1
|
||||||
|
cd .. || exit 1
|
||||||
|
elif [[ $1 == "stocks" ]]; then
|
||||||
|
cd stocks || exit 1
|
||||||
|
./install.sh || exit 1
|
||||||
|
cd .. || exit 1
|
||||||
|
elif [[ $1 == "weather" ]]; then
|
||||||
|
cd weather || exit 1
|
||||||
|
./install.sh || exit 1
|
||||||
|
cd .. || exit 1
|
||||||
|
elif [[ $1 == "crypt" ]]; then
|
||||||
|
cd crypt || exit 1
|
||||||
|
./install.sh || exit 1
|
||||||
|
cd .. || exit 1
|
||||||
|
elif [[ $1 == "movies" ]]; then
|
||||||
|
cd movies || exit 1
|
||||||
|
./install.sh || exit 1
|
||||||
|
cd .. || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Bash Snippets version $currentVersion"
|
||||||
|
echo "https://github.com/alexanderepstein/Bash-Snippets"
|
||||||
|
62
uninstall.sh
62
uninstall.sh
@ -1,16 +1,50 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# Author: Alexander Epstein https://github.com/alexanderepstein
|
||||||
cd currency || exit 1
|
|
||||||
./uninstall.sh || exit 1
|
|
||||||
cd .. || exit 1
|
echo -n "Do you wish to uninstall currency [Y/n]: "
|
||||||
cd stocks || exit 1
|
read -r answer
|
||||||
./uninstall.sh
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
cd .. || exit 1
|
cd currency || exit 1
|
||||||
cd weather || exit 1
|
./uninstall.sh || exit 1
|
||||||
./uninstall.sh
|
cd .. || exit 1
|
||||||
cd .. || exit 1
|
fi
|
||||||
cd crypt || exit 1
|
|
||||||
./uninstall.sh
|
unset answer
|
||||||
cd .. || exit 1
|
echo -n "Do you wish to uninstall stocks [Y/n]: "
|
||||||
cd movies || exit 1
|
read -r answer
|
||||||
./uninstall.sh
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd stocks || exit 1
|
||||||
|
./uninstall.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset answer
|
||||||
|
echo -n "Do you wish to uninstall weather [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd weather || exit 1
|
||||||
|
./uninstall.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset answer
|
||||||
|
echo -n "Do you wish to uninstall crypt [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd crypt || exit 1
|
||||||
|
./uninstall.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset answer
|
||||||
|
echo -n "Do you wish to uninstall movies [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd movies || exit 1
|
||||||
|
./uninstall.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user