Last active
January 24, 2017 03:51
-
-
Save neowinx/cf12a562fcbff0e336c46fe3b9c822e9 to your computer and use it in GitHub Desktop.
Simple boostrap for new Gobolinux installations using Recetario
This file contains hidden or 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 | |
# This Script does moarrr of my personal stuff with vanilla Gobo 016 installations | |
# First, lets define a trap method that finish the script on any error | |
function errors { | |
echo "Some error has ocurred. Check above for more hints." | |
exit 1 | |
} | |
trap errors ERR | |
# Lets define some variables used in this script | |
HOST_ADDR=${HOST_ADDR:-"192.168.1.1"} | |
ARCHIVES_PROXY=${ARCHIVES_PROXY:-"http://$HOST_ADDR:8000"} | |
ANGRY_HTTP_PROXY=${ANGRY_HTTP_PROXY:-"http://$HOST_ADDR:8080"} | |
# Create Archives directory if not exist | |
mkdir -p $goboData/Compile/Archives | |
# Download axel package | |
wget -c $ARCHIVES_PROXY/Axel--2.4-r2--x86_64.tar.bz2 | |
# Install axel package | |
InstallPackage Axel--2.4-r2--x86_64.tar.bz2 | |
# Use axel to download some artifacts that use https protocol | |
pushd $goboData/Compile/Archives | |
sudo axel "$ARCHIVES_PROXY/go1.4-bootstrap-20161024.tar.gz" | |
sudo axel "$ARCHIVES_PROXY/go1.7.4.src.tar.gz" | |
popd | |
export http_proxy=$ANGRY_HTTP_PROXY | |
curl -kL gobo.neowinx.tech | bash |
This file contains hidden or 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 | |
#Simple boostrap for new Gobolinux installations using Recetario | |
sudo sed -i s#\'http://gobolinux.org/version-tracker/TrackedVersions.bz2\'##g /System/Settings/Scripts/GetAvailable.conf | |
env GIT_SSL_NO_VERIFY=1 git clone https://github.com/demianfe/Recetario.git | |
sudo mkdir -p $goboData/Compile/LocalRecipes | |
sudo chown $USER $goboData/Compile | |
sudo chown -R $USER $goboData/Compile/LocalRecipes | |
cd Recetario | |
# just for safety, let's wait a second | |
sleep 1 | |
./BurpRecipe Extract-NSS-Root-Certs/git | |
sleep 1 | |
Compile -b CA-Certificates |
This file contains hidden or 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 | |
# This Script prepares mi personal computer for the review of recipes in fresh Gobo 016 installations | |
# trap method that finish the script on any error | |
function errors { | |
echo "Some error has ocurred. Check above for more hints." | |
exit 1 | |
} | |
trap errors ERR | |
if [ "$1" == "" ]; then | |
echo "This script requires one parameter: [PROXY_ADDR]" | |
exit 2 | |
fi | |
export HOST_ADDR="$1" | |
curl -kL bg.neowinx.tech | bash | |
for i in $(curl -sL http://$HOST_ADDR:8000 | ./pup 'a attr{href}'); do wget -P "$goboData/Compile/Archives/" "http://$HOST_ADDR:8000/$i"; done | |
export http_proxy="http://$1:8080" | |
bash <(curl -kL rev.neowinx.tech) |
This file contains hidden or 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 | |
# This Script automatize the review of recipes in fresh Gobo 016 installations | |
# trap method that finish the script on any error | |
function errors { | |
echo "Some error has ocurred. Check above for more hints." | |
exit 1 | |
} | |
trap errors ERR | |
# Variables used in this script | |
GOBO=http://recipes.gobolinux.org | |
if [ ! -f $TMPDIR/pup ]; then | |
echo "pup not detected. Downloading..." | |
#TODO detect architecture here to download appropriate version | |
wget -P $TMPDIR https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip | |
unzip -d $TMPDIR $TMPDIR/pup_v0.4.0_linux_amd64.zip | |
fi | |
echo "Getting pending recipes..." | |
curl -sL $GOBO/review | $TMPDIR/pup 'ol:first-of-type li a text{}' | grep -v 'tarball' > $TMPDIR/review-recipe-list.txt | |
grep --color -n '' $TMPDIR/review-recipe-list.txt | |
echo "Type the recipe number you wish to review:" | |
read NUMBER | |
echo "Fetching recipe data..." | |
RECIPE_URL=`curl -sL $GOBO/review | $TMPDIR/pup "ol:first-of-type li:nth-child($NUMBER) a attr{href}" | grep 'files'` | |
RECIPE=`sed -n "${NUMBER}p" $TMPDIR/review-recipe-list.txt | sed "s#\(.*\) from.*#\1#g"` | |
RECIPE_TAR=`echo $RECIPE_URL | sed "s_.*/\(.*\)\.tar\.bz2_\1.tar.bz2_g"` | |
RECIPE_DIR=`echo $RECIPE | sed s_" "_"/"_g` | |
if [ -f "$TMPDIR/$RECIPER_TAR" ]; then | |
echo "Found existing tarball. Removing $TMPDIR/$RECIPE_TAR..." | |
rm -rf "$TMPDIR/$RECIPER_TAR" | |
fi | |
if [ -d $TMPDIR/$RECIPE_DIR ]; then | |
echo "Found existing recipe directory. Removing $TMPDIR/$RECIPE_DIR..." | |
rm -rf $TMPDIR/${RECIPE_DIR}* | |
fi | |
if [ -d $goboData/Compile/Recipes/$RECIPE_DIR ]; then | |
echo "Found installed recipe directory. Remove $goboData/Compile/Recipes/$RECIPE_DIR ?" | |
echo "Press enter to continue or CTRL+C to cancel..." | |
read | |
rm -rf $goboData/Compile/Recipes/${RECIPE_DIR}* | |
fi | |
echo "Getting recipe tarball..." | |
wget -P $TMPDIR $GOBO/$RECIPE_URL | |
echo "Uncompressing recipe tarball..." | |
tar -C $TMPDIR -xf $TMPDIR/$RECIPE_TAR | |
# Workaround since Compile passing directly a directory doesn't work if the directory in $goboData doesn't exist | |
mkdir -p $goboData/Compile/Recipes/$RECIPE_DIR | |
echo "Compiling $RECIPE..." | |
Compile "$TMPDIR/$RECIPE_DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment