Last active
June 7, 2020 13:30
-
-
Save lazerl0rd/65925629627de671ac9ba46eff4667df to your computer and use it in GitHub Desktop.
A Shell Script to maintain *ra1n bootstrap installers
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
#!/usr/bin/env bash | |
# A Shell Script to maintain *ra1n bootstrap installers. | |
# Diab Neiroukh - 6/Jun/2020 (Licensed under the GNU GPLv3) | |
SCRIPTDIR="/usr/local/share/odysseyra1n" | |
SCRIPTLINK="https://raw.githubusercontent.com/coolstar/Odyssey-bootstrap/master/procursus-deploy-linux-macos.sh" | |
SCRIPTNAME="procursus-deploy-linux-macos.sh" | |
SCRIPTNEEDROOT=true | |
notifyuser() | |
{ | |
echo "" | |
echo "$@" | |
echo "" | |
} | |
wget -q --spider http://github.com | |
if [[ $? == 0 ]]; then | |
cd "$SCRIPTDIR" || mkdir "$SCRIPTDIR" | |
if $SCRIPTNEEDROOT; then | |
if [[ $UID == 0 ]]; then | |
curl -fsSL "$SCRIPTLINK" -o "$SCRIPTDIR/$SCRIPTNAME" | |
chmod +x "$SCRIPTDIR/$SCRIPTNAME" | |
else | |
notifyuser "Not running as root, will not update..." | |
fi | |
fi | |
bash -c "$SCRIPTDIR/$SCRIPTNAME" | |
else | |
if [[ -d $SCRIPTDIR ]]; then | |
bash -c "$SCRIPTDIR/$SCRIPTNAME" | |
else | |
notifyuser "Script not found, run once as root with a valid internet connection..." | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment