### Generic variables and functions
### -------------------------------

if [ -z "${SYNOPKG_PKGNAME}" ] || [ -z "${SYNOPKG_DSM_VERSION_MAJOR}" ]; then
  echo "Error: Environment variables are not set." 1>&2;
  echo "Please run me using synopkg instead. Example: \"synopkg start [packagename]\"" 1>&2;
  exit 1
fi

USER="fish"
EFF_USER="sc-fish"



### Package specific variables and functions
### ----------------------------------------

# shellcheck shell=sh

service_save() {
    echo "Back up /etc"
    $MV "$SYNOPKG_PKGDEST"/etc "$TMP_DIR"
}

service_restore() {
    echo "Restore /etc"
    $RM "$SYNOPKG_PKGDEST"/etc
    $MV "$TMP_DIR"/etc "$SYNOPKG_PKGDEST"
}
