Display exit code

Display exit code
This commit is contained in:
Kroese 2023-04-30 21:59:40 +02:00 committed by GitHub
commit 1edc5f81ec
3 changed files with 8 additions and 9 deletions

View File

@ -11,7 +11,7 @@
[![Docker Image Size]][dsm-docker-hub]
[![Docker Pulls Count]][dsm-docker-hub]
[build_url]: https://github.com/kroese/virtual-dsm/actions
[build_url]: https://github.com/kroese/virtual-dsm/
[dsm-docker-hub]: https://hub.docker.com/r/kroese/virtual-dsm
[build_img]: https://github.com/kroese/virtual-dsm/actions/workflows/build.yml/badge.svg

View File

@ -39,7 +39,7 @@ LOC="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
SUM=$(md5sum "$RD" | cut -f 1 -d " ")
if [ "$SUM" != "14fb88cb7cabddb5af1d0269bf032845" ]; then
echo "ERROR: Invalid extractor, checksum mismatch." && exit 61
echo "ERROR: Invalid file, checksum mismatch: $SUM" && exit 61
fi
set +e
@ -69,9 +69,8 @@ else
PROGRESS="--progress=dot:giga"
fi
if ! wget "$URL" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS"; then
echo "ERROR: Failed to download $URL" && exit 69
fi
{ wget "$URL" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS"; rc=$?; } || :
(( rc != 0 )) && echo "ERROR: Failed to download $URL, reason: $rc" && exit 69
[ ! -f "$PAT" ] && echo "ERROR: Failed to download $URL" && exit 69

View File

@ -25,7 +25,7 @@ configureDHCP() {
NETWORK=$(ip -o route | grep "${VM_NET_DEV}" | grep -v default | awk '{print $1}')
IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
{ ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge > /dev/null 2>&1 ; rc=$?; } || :
{ ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge 2> /dev/null ; rc=$?; } || :
if (( rc != 0 )); then
echo -n "ERROR: Capability NET_ADMIN has not been set ($rc/1). Please add the "
@ -43,7 +43,7 @@ configureDHCP() {
echo "INFO: Acquiring an IP address via DHCP using MAC address ${VM_NET_MAC}..."
{ ip link add link "${VM_NET_DEV}" name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge > /dev/null 2>&1 ; rc=$?; } || :
{ ip link add link "${VM_NET_DEV}" name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge 2> /dev/null ; rc=$?; } || :
if (( rc != 0 )); then
echo -n "ERROR: Capability NET_ADMIN has not been set ($rc/2). Please add the "
@ -114,7 +114,7 @@ configureNAT () {
#Create bridge with static IP for the VM guest
{ ip link add dev dockerbridge type bridge > /dev/null 2>&1 ; rc=$?; } || :
{ ip link add dev dockerbridge type bridge 2> /dev/null ; rc=$?; } || :
if (( rc != 0 )); then
echo -n "ERROR: Capability NET_ADMIN has not been set ($rc/3). Please add the "
@ -141,7 +141,7 @@ configureNAT () {
#Check port forwarding flag
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null 2>&1; rc=$?; } || :
{ sysctl -w net.ipv4.ip_forward=1 2> /dev/null ; rc=$?; } || :
if (( rc != 0 )); then
echo -n "ERROR: IP forwarding is disabled ($rc). Please add the following "
echo "docker setting to your container: --sysctl net.ipv4.ip_forward=1" && exit 24