Unverified Commit 2b5ed10a authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Minor changes

Minor changes
parents 17ae5328 cd623fda
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
#!/usr/bin/env bash
set -eu
set -u

# Docker Healthcheck

@@ -14,7 +14,6 @@ fi
IP=$(cat "${FILE}")

if ! curl -m 3 -ILfSs "http://${IP}:${PORT}/" > /dev/null; then
  echo "Failed to reach ${IP}:${PORT}"
  exit 1
fi

+4 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ if [ -f "${DATA}" ]; then

    if [ "$ALLOCATE" = "N" ]; then

      # Resize file by changing its length
      truncate -s "${DATA_SIZE}" "${DATA}"; 

    else
@@ -51,6 +52,7 @@ if [ -f "${DATA}" ]; then
        echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATE=N." && exit 84
      fi

      # Resize file by allocating more space
      if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
        echo "ERROR: Could not allocate a file for the virtual disk." && exit 85
      fi
@@ -78,10 +80,9 @@ fi

if [ ! -f "${DATA}" ]; then

  # Create an empty file

  if [ "$ALLOCATE" = "N" ]; then

    # Create an empty file
    truncate -s "${DATA_SIZE}" "${DATA}"

  else
@@ -94,6 +95,7 @@ if [ ! -f "${DATA}" ]; then
      echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATE=N." && exit 86
    fi

    # Create an empty file
    if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
      rm -f "${DATA}"
      echo "ERROR: Could not allocate a file for the virtual disk." && exit 87
+0 −2
Original line number Diff line number Diff line
@@ -2,14 +2,12 @@
set -eu

# Display wait message on port 5000

HTML="Please wait while Virtual DSM is installing...<script>\
        setTimeout(() => { document.location.reload(); }, 9999);</script>"

/run/server.sh 5000 "${HTML}" > /dev/null &

# Download the required files from the Synology website

DL="https://global.synologydownload.com/download/DSM"

if [ -z "$URL" ]; then
+5 −4
Original line number Diff line number Diff line
@@ -159,7 +159,8 @@ configureNAT () {
    [[ -z $(hostname -d) ]] || DNSMASQ_OPTS="$DNSMASQ_OPTS --dhcp-option=option:domain-name,$(hostname -d)"
  fi

  [ "$DEBUG" = "Y" ] && echo && echo "$DNSMASQ $DNSMASQ_OPTS"
  DNSMASQ_OPTS=$(echo "$DNSMASQ_OPTS" | sed 's/\t/ /g' | tr -s ' ' | sed 's/^ *//')
  [ "$DEBUG" = "Y" ] && echo "$DNSMASQ $DNSMASQ_OPTS" && echo

  $DNSMASQ ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS}
}
@@ -185,9 +186,9 @@ GATEWAY=$(ip r | grep default | awk '{print $3}')
if [ "$DEBUG" = "Y" ]; then

  IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
  echo "Info: Container IP is ${IP} with gateway ${GATEWAY}"
  ifconfig
  ip route
  echo "Info: Container IP is ${IP} with gateway ${GATEWAY}" && echo
  ifconfig && echo
  ip route && echo

fi

+4 −2
Original line number Diff line number Diff line
@@ -61,11 +61,13 @@ KVM_OPTS="-machine type=q35,usb=off${KVM_OPTS}"
RAM_OPTS=$(echo "-m ${RAM_SIZE}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
CPU_OPTS="-smp ${CPU_CORES},sockets=1,cores=${CPU_CORES},threads=1"
EXTRA_OPTS="-device virtio-balloon-pci,id=balloon0 -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0"

ARGS="${DEF_OPTS} ${CPU_OPTS} ${RAM_OPTS} ${KVM_OPTS} ${MON_OPTS} ${SERIAL_OPTS} ${NET_OPTS} ${DISK_OPTS} ${EXTRA_OPTS}"
ARGS=$(echo "$ARGS" | sed 's/\t/ /g' | tr -s ' ')

if [ "$DEBUG" = "Y" ]; then
  echo && echo -n "qemu-system-x86_64 "
  echo "${ARGS}"
  echo -n "qemu-system-x86_64 "
  echo "${ARGS}" && echo
fi

set -m
Loading