Return on failure
This commit is contained in:
parent
b111378a4d
commit
d8a3f5f4de
2 changed files with 6 additions and 6 deletions
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
if test -z $argv[1]
|
if test -z $argv[1]
|
||||||
echo "A container number is required as the first argument!"
|
echo "A container number is required as the first argument!"
|
||||||
exit 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l container_name ttyd$argv[1]
|
set -l container_name ttyd$argv[1]
|
||||||
set -l container_volumes_dir ~/volumes/$container_name
|
set -l container_volumes_dir ~/volumes/$container_name
|
||||||
set -l container_home_dir $container_volumes_dir/home
|
set -l container_home_dir $container_volumes_dir/home
|
||||||
|
|
||||||
mkdir -p $container_volumes_dir
|
mkdir -p $container_volumes_dir; or return 1
|
||||||
|
|
||||||
if not test -d $container_home_dir
|
if not test -d $container_home_dir
|
||||||
cp -r ~/fedora_home_clone $container_home_dir
|
cp -r ~/fedora_home_clone $container_home_dir; or return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
podman-default-create \
|
podman-default-create \
|
||||||
|
|
|
@ -6,10 +6,10 @@ if test -z "$STUDENT_USER_PASSWORD" || test -z "$TTYD_USER" || test -z "$TTYD_PA
|
||||||
end
|
end
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
podman rmi -i ttyd
|
podman rmi -i ttyd; or return 1
|
||||||
buildah rm builder &>/dev/null
|
buildah rm builder &>/dev/null
|
||||||
|
|
||||||
buildah from --pull --name builder registry.fedoraproject.org/fedora:latest
|
buildah from --pull --name builder registry.fedoraproject.org/fedora:latest; or return 1
|
||||||
|
|
||||||
# Remove the flag that prevents installing docs
|
# Remove the flag that prevents installing docs
|
||||||
buildah run builder -- sed -i /nodocs/d /etc/dnf/dnf.conf
|
buildah run builder -- sed -i /nodocs/d /etc/dnf/dnf.conf
|
||||||
|
@ -53,6 +53,6 @@ buildah unshare -- sh (status dirname)/buildah_unshare.sh
|
||||||
buildah config \
|
buildah config \
|
||||||
--workingdir /home/student \
|
--workingdir /home/student \
|
||||||
--cmd "bash -c 'chown -R student:student /home/student && runuser -u student -- ttyd -c $TTYD_USER:$TTYD_PASSWORD bash'" \
|
--cmd "bash -c 'chown -R student:student /home/student && runuser -u student -- ttyd -c $TTYD_USER:$TTYD_PASSWORD bash'" \
|
||||||
builder
|
builder; or return 1
|
||||||
|
|
||||||
buildah commit --rm builder ttyd
|
buildah commit --rm builder ttyd
|
||||||
|
|
Loading…
Add table
Reference in a new issue