#!/bin/sh # # Bash Script Mirror # Mirror untuk membuat repository online # oleh Andrian Dion P. # (C) 2008 GPL v2 #variabel v="0.1" APT_INSTALL="apt-get -y install" MIRROR="/usr/bin/debmirror" HOST="repo.ugm.ac.id" ROOT="debian" METHOD="http" SECTION="contrib,main,non-free" ARCH="i386" clear echo "--------------------------------------------------" echo "| Script Mirror Repo Debian $v |" echo "| Oleh : Andrian Dion P. |" echo "--------------------------------------------------" sleep 1 echo "checking tool debmirror already install or not.." if `dpkg -l | awk {'print $2'} | grep -qx debmirror` ; then $(exit 0) else sudo $APT_INSTALL debmirror fi ############################################# #echo "Masukkan method, default (http)" #read -p "Using Default, Enter y or n: " RESPONSE #if [ "$RESPONSE" = y ] ; then # METHOD="http" #elif [ "$RESPONSE" = n ] ; then # echo -en "entry : " # read METHOD #else # echo "You did not make a valid selection!" #fi #sleep 1 #clear ############################################# #echo "Masukkan host, default (repo.ugm.ac.id)" #read -p "Using Default, Enter y or n: " RESPONSE #if [ "$RESPONSE" = y ] ; then # HOST="repo.ugm.ac.id" #elif [ "$RESPONSE" = n ] ; then # echo -en "entry : " # read HOST #else # echo "You did not make a valid selection!" #fi #sleep 1 #clear ############################################# #echo "Masukkan root, default (ubuntu)" #read -p "Using Default, Enter y or n: " RESPONSE #if [ "$RESPONSE" = y ] ; then # ROOT="ubuntu" #elif [ "$RESPONSE" = n ] ; then # echo -en "entry : " # read ROOT #else # echo "You did not make a valid selection!" #fi #sleep 1 #clear ############################################# echo -en "\n Masukkan codename distro Debian ex. lenny,squeeze Keterangan : lenny (5.0) oldstable squeeze (6.0) stable entry : " read DIST sleep 1 clear ############################################# #echo "Masukkan section, default (main,multiverse,universe,restricted)" #read -p "Using Default, Enter y or n: " RESPONSE #if [ "$RESPONSE" = y ] ; then # SECTION="main,multiverse,universe,restricted" #elif [ "$RESPONSE" = n ] ; then # echo -en "entry : " # read SECTION #else # echo "You did not make a valid selection!" #fi #sleep 1 #clear ############################################# echo "Masukkan Machine architecture [amd64,i386]; default (i386)" read -p "Using Default, Enter y or n: " RESPONSE if [ "$RESPONSE" = y ] ; then ARCH="i386" elif [ "$RESPONSE" = n ] ; then echo -en "entry : " read ARCH else echo "You did not make a valid selection!" fi sleep 1 clear ############################################# echo -en "\n Masukkan target lokasi ex. /media/data atau ./ entry : " read TARGET sleep 1 clear echo "checking directory for mirroring" if ls $TARGET | grep -qx debian ; then $(exit 0) else mkdir $TARGET/debian fi #echo "Nama Mirror = $NAME" echo "Distro = $DIST" echo "Source = $METHOD://$HOST/$ROOT" echo "Section = $SECTION" echo "Target lokasi = $TARGET/debian" echo "Architect = $ARCH" read -p "Whether the information is correct, Enter yes or no: " RESPONSE if [ "$RESPONSE" = yes ] ; then echo "Your answered yes!" cat > mirror.sh <