Skip to content

Commit

Permalink
Attemptive fix at configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
smaarn committed May 3, 2022
1 parent 7e36674 commit 101ab90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spk/memcached/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PATH="${SYNOPKG_PKGDEST}/bin:/usr/local/bin:/bin:/usr/bin:/usr/syno/bin"
MEMCACHED="${SYNOPKG_PKGDEST}/bin/memcached"
SERVICE_COMMAND="${MEMCACHED} -d -m `awk '/MemTotal/{memory=$2/1024*0.15; if (memory > 64) memory=64; printf "%0.f", memory}' /proc/meminfo` -P ${PID_FILE}"
CONFIG_DIR="${WEB_DIR}/phpMemcachedAdmin/Config"
CONFIG_FILE="${CONFIG_DIR}/Memcache.php"
CONFIG_BACKUP="${TMP_DIR}/Config"

service_postinst ()
Expand All @@ -22,13 +23,13 @@ service_postinst ()
fi

if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then
cp -pv "${CONFIG_DIR}/Memcache.sample.php" "${CONFIG_DIR}/Memcache.php"
cp -v "${CONFIG_DIR}/Memcache.sample.php" "${CONFIG_FILE}"
chgrp http "${CONFIG_FILE}"
chmod g+w "${CONFIG_FILE}"
elif [ -d "${CONFIG_BACKUP}" ]; then
tar -cf - -C "${CONFIG_BACKUP}" --exclude="Memcache.sample.php" . | tar -xvf - -C "${CONFIG_DIR}"
else
cp -pv "${CONFIG_DIR}/Memcache.sample.php" "${CONFIG_DIR}/Memcache.php"
cp -v "${CONFIG_DIR}/Memcache.sample.php" "${CONFIG_FILE}"
chgrp http "${CONFIG_FILE}"
chmod g+w "${CONFIG_FILE}"
fi
Expand Down

0 comments on commit 101ab90

Please sign in to comment.