#!/bin/sh case $1 in help) printf "usage: elif-setup [live] [tar] [help]\n" exit 0 ;; live) printf "[ i ] Setting up ELIF for target 'live'\n" printf "[ i ] Parsing setup.conf...\n" source $(pwd)/setup.conf printf "[ i ] Mounting partitions...\n" mount $EVEREST_DISK $EVEREST printf "[ i ] Downloading rootfs image...\n" cd $EVEREST wget $EVEREST_ROOTFS_IMG printf "[ i ] Exporting variables...\n" echo EVEREST=$EVEREST >> /etc/profile echo EVEREST_DISK=$EVEREST_DISK >> /etc/profile echo EVEREST_ROOTFS_IMG=$EVEREST_ROOTFS_IMG >> /etc/profile source /etc/profile printf "[ \xE2\x9C\x93 ] Finished setup.\n" ;; tar) printf "[ i ] Setting up ELIF for target 'tar'\n" printf "[ i ] Parsing setup.conf...\n" source $(pwd)/setup.conf printf "[ i ] Creating temporary build user...\n" useradd everest-temp printf "[ i ] Creating $EVEREST...\n" mkdir $EVEREST chown -Rv everest-temp $EVEREST printf "[ i ] Mounting partitions...\n" mount $EVEREST_DISK $EVEREST printf "[ i ] Downloading rootfs image...\n" cd $EVEREST wget $EVEREST_ROOTFS_IMG printf "[ i ] Exporting variables...\n" echo EVEREST=$EVEREST >> /etc/profile echo EVEREST_DISK=$EVEREST_DISK >> /etc/profile echo EVEREST_ROOTFS_IMG=$EVEREST_ROOTFS_IMG >> /etc/profile source /etc/profile printf "[ \xE2\x9C\x93 ] Finished setup.\n" ;; *) printf "[ X ] Option '$1' not found\n" esac