Streaming install scripts
This commit is contained in:
19
install.sh
19
install.sh
@@ -9,7 +9,6 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
DOTDIR="/var/lib/dotfiles"
|
DOTDIR="/var/lib/dotfiles"
|
||||||
_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
||||||
|
|
||||||
os_release_file=/etc/os-release
|
os_release_file=/etc/os-release
|
||||||
if [[ ! -e "${os_release_file}" ]] ; then
|
if [[ ! -e "${os_release_file}" ]] ; then
|
||||||
@@ -69,22 +68,4 @@ fi
|
|||||||
|
|
||||||
[[ -e './.git' ]] && git submodule update --init
|
[[ -e './.git' ]] && git submodule update --init
|
||||||
|
|
||||||
if [[ "$(readlink "${_SCRIPT_DIR}")" != "${DOTDIR}" ]] && [[ "${_SCRIPT_DIR}" != "${DOTDIR}" ]] ; then
|
|
||||||
if [[ -e "${DOTDIR}" ]] ; then
|
|
||||||
2>&1 printf "${DOTDIR} already exists. This seems unsafe.\n"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
printf "Moving directory to $DOTDIR ...\n"
|
|
||||||
sudo=""
|
|
||||||
if (( $(id -u ) != 0 )) ; then
|
|
||||||
sudo=sudo
|
|
||||||
fi
|
|
||||||
$sudo mv --no-target-directory "${_SCRIPT_DIR}" "${DOTDIR}"
|
|
||||||
printf "Done\n"
|
|
||||||
else
|
|
||||||
printf "Already working in ${DOTDIR}, nothing to do\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "${DOTDIR}"
|
|
||||||
|
|
||||||
cd "${DOTDIR}" && make
|
cd "${DOTDIR}" && make
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ if /var/lib/dotfiles/install.sh ; then
|
|||||||
reboot
|
reboot
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
CHROOTSCRIPT
|
CHROOTSCRIPT
|
||||||
|
|
||||||
chmod +x /mnt/chroot-script.sh
|
chmod +x /mnt/chroot-script.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user