Skip to content

Commit

Permalink
Merge pull request #26 from WDCommunity/duplimono
Browse files Browse the repository at this point in the history
Added ARM support
  • Loading branch information
stefaang authored Jan 16, 2019
2 parents 5de3aba + 49c548f commit 412b1d0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 5 additions & 1 deletion build_and_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ PACKAGE=$1
docker run -it -v $(pwd):/wdpksrc wdpk /bin/bash -c "cd wdpk/$PACKAGE; ./build.sh; chown -R 1000:1000 ../../packages/$PACKAGE"

# find latest package
PRODUCT="PR4100" # TODO: use env
if [ -z "$3" ]; then
PRODUCT="PR4100" # TODO: use env
else
PRODUCT="$3"
fi

BINARY=$(find -name "*$PRODUCT*$PACKAGE*.bin" | sort | head -n1)
echo "Created $BINARY"
Expand Down
2 changes: 1 addition & 1 deletion wdpk/duplicati/apkg.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: duplicati
Version: 0.04
Version: 0.05
Packager: TFL
Email:
Homepage: https://www.duplicati.com
Expand Down
17 changes: 12 additions & 5 deletions wdpk/duplicati/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,34 @@ cp -rf $path_src $NASPROG

cd "${APKG_PATH}"

# setup secure downloads
if [ ! -f /etc/ssl/cert.pem ]; then
curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
mv cacert.pem /etc/ssl/cert.pem
fi

# ensure we have mono installed
MONO_DIR="${NASPROG}/mono"
MONO_LIB="${MONO_DIR}/lib"
MONO="${MONO_DIR}/bin/mono"

if [ ! -d "${MONO_DIR}" ]; then
ARCH="$(uname -m)"

echo "Download the mono $ARCH build based on the synocommunity project" >> $log
wget "https://github.com/WDCommunity/wdpksrc/releases/download/duplicati/mono-${ARCH}-6.1_5.8.0.108-11.tar" --no-check-certificate
wget "https://github.com/WDCommunity/wdpksrc/releases/download/duplicati/mono-${ARCH}-6.1_5.8.0.108-11.tar" -O mono.tar
# wget https://usdl.synology.com/download/Package/spk/Mono/4.6.2-0096/Mono-$ARCH-4.6.2-0096.spk -O mono.tar
[[ "$?" -ne 0 ]] && exit 1
mkdir -p "${MONO_DIR}"
tar xf mono*.tar -C "${MONO_DIR}" >> $log
tar xf mono.tar -C "${MONO_DIR}" >> $log
tar xf "${MONO_DIR}/package.tgz" -C "${MONO_DIR}" >> $log
rm "${MONO_DIR}/package.tgz"
rm mono*.tar
rm mono.tar
else
echo "Mono dir already exists" >> $log
fi

echo "Download the official duplicati package for synology" >> $log
wget https://github.com/duplicati/duplicati/releases/download/v2.0.4.10-2.0.4.10_canary_2018-12-29/duplicati-2.0.4.10_canary_2018-12-29.spk --no-check-certificate
wget https://github.com/duplicati/duplicati/releases/download/v2.0.4.10-2.0.4.10_canary_2018-12-29/duplicati-2.0.4.10_canary_2018-12-29.spk

# extract the spk archive
mv duplicati*.spk duplicati.tar
Expand Down
2 changes: 1 addition & 1 deletion wdpk/duplicati/start-stop-status
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ DaemonStop() {
DaemonStatus
if [ $? == 1 ]; then
echo "Stopping ${PACKAGE_NAME_SIMPLE}."
kill $(ps -ef | awk '/[D]uplicati/{print $1}') # mono spawns 2 pids!
kill $(ps -w | awk '/[D]uplicati/{print $1}') # mono spawns 2 pids!
rm -f "$PID_FILE"
# TODO: use a lighttpd conf for WD MyCloud
#rm -f /usr/local/etc/nginx/conf.d/dsm.duplicati.conf
Expand Down

0 comments on commit 412b1d0

Please sign in to comment.