Change variable to something more readable and more short
This commit is contained in:
parent
e0e576ff0e
commit
6d93d48059
@ -22,7 +22,7 @@ But you can change destination directory if needed:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
chmod +x ./install-and-chroot.sh
|
chmod +x ./install-and-chroot.sh
|
||||||
DIR="/my_alpine_chroot" ./install-and-chroot.sh
|
DIRPATH="/my_alpine_chroot" ./install-and-chroot.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
and then:
|
and then:
|
||||||
@ -31,6 +31,8 @@ and then:
|
|||||||
/my_alpine_chroot/enter-chroot
|
/my_alpine_chroot/enter-chroot
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Pay attention: DIRPATH should be an absolute path.
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
* adapt script to install yunoconfig dependencies (alpine-chroot-install -p)
|
* adapt script to install yunoconfig dependencies (alpine-chroot-install -p)
|
||||||
|
@ -1,25 +1,24 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
alpine_install=${INSTALL:-'alpine-chroot-install'}
|
SCRIPT=${SCRIPTNAME:-'alpine-chroot-install'}
|
||||||
alpine_directory=${DIR:-'/alpine'}
|
DIR=${DIRPATH:-'/alpine'}
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
DIR="${alpine_directory}"
|
|
||||||
if ! [[ $DIR == /* ]]; then
|
if ! [[ $DIR == /* ]]; then
|
||||||
echo "DIR is not an absolute URL. It should start with a '/'" && exit 1
|
echo "DIRPATH is not an absolute URL. It should start with a '/'" && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# DL alpine install script
|
# DL alpine install script
|
||||||
if ! test -f "$alpine_install"; then
|
if ! test -f "$SCRIPT"; then
|
||||||
wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.9.0/alpine-chroot-install -O "$alpine_install" \
|
wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.9.0/alpine-chroot-install -O "$SCRIPT" \
|
||||||
&& echo 'e5dfbbdc0c4b3363b99334510976c86bfa6cb251 alpine-chroot-install' | sha1sum -c \
|
&& echo "e5dfbbdc0c4b3363b99334510976c86bfa6cb251 ${SCRIPT}" | sha1sum -c \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
chmod +x "$alpine_install"
|
chmod +x "$SCRIPT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install Alpine
|
# Install Alpine
|
||||||
if ! test -d "$DIR"; then
|
if ! test -d "$DIR"; then
|
||||||
sudo sh ./$alpine_install -d $DIR -p build-base -p git -p zsh -p lua-filesystem -p luarocks5.1 -p lua-toml -p moonscript -p abuild -p lua-argparse || exit 1
|
sudo sh ./$SCRIPT -d $DIR -p build-base -p git -p zsh -p lua-filesystem -p luarocks5.1 -p lua-toml -p moonscript -p abuild -p lua-argparse || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set rc_sys="prefix" to not disturb systemd on current system
|
# Set rc_sys="prefix" to not disturb systemd on current system
|
||||||
|
Loading…
Reference in New Issue
Block a user