diff --git a/comfy.sh b/comfy.sh new file mode 100644 index 0000000000000000000000000000000000000000..346ee3740a3ad3b50becd8d7cac4a1754dd0e304 --- /dev/null +++ b/comfy.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# +# comfy-netbsd.sh - Get comfy on NetBSD +# +# + +# Get architecture, relase etc to build repository path +ARCH=`grep MACHINE_ARCH /etc/release | awk '{print $3}' | sed "s/'//g"` +VER=`grep DISTRIBVER /etc/release | awk '{print $3}' | sed "s/'//g"` + +# Package list to be installed, as you see fit +PKGLIST="wget nano free vim tmux bash curl sudo psmisc mtr htop mozilla-rootcerts* git alpine elinks" + +# Path to prebuild binnary packages, using http because at this point we don't have root ca certificates +export PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$ARCH/$VER/All/" + +TEMP_DIR=/tmp/comfy +mkdir -p $TEMP_DIR || exit 1 +cd $TEMP_DIR || exit 1 +TEMP=$TEMP_DIR/comfy.tmp.$$ + +echo "Initial setup, installing pkgin..." +ftp -p ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/$ARCH/$VER/All/pkgin-*.tgz || exit 1 +ftp -p ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/$ARCH/$VER/All/pkg_install-20*.tgz || exit 1 +pkg_add `ls pkgin-*.tgz` + +# Setup pkgin repository for this system +cat /usr/pkg/etc/pkgin/repositories.conf | sed 's/^ftp/# disabled by comfy: ftp/' > /usr/pkg/etc/pkgin/repositories.conf.1 +cat /usr/pkg/etc/pkgin/repositories.conf.1 > /usr/pkg/etc/pkgin/repositories.conf +rm /usr/pkg/etc/pkgin/repositories.conf.1 + +echo "ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/\$arch/\$osrelease/All" > /usr/pkg/etc/pkgin/repositories.conf +echo "Updating pkgin database with current prebuilt binnaires..." + +pkgin update || exit 1 + +echo "Listing available packages..." +pkgin avail > $TEMP + +echo "Entering the package install loop..." +echo " " + +for p in $PKGLIST; do + grep "^$p\-" $TEMP | head -n 1 + echo -n "Install $p ? (y/n) " + read r + if [ "$r" = "y" ]; then + pkgin -y install $p + fi + echo " " +done + +cd $HOME +rm -fr $TEMP_DIR +echo "bye!" +exit 0