-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor installation fixes
- Loading branch information
Showing
13 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Package: syncthing | ||
Version: 1.1.0 | ||
Packager: TFL | ||
Email: | ||
Homepage: https://www.syncthing.net | ||
Description: Open Source Continuous File Synchronization | ||
Icon: logo.png | ||
AddonShowName: Syncthing | ||
AddonIndexPage: index.php | ||
AddonUsedPort: | ||
InstDepend: | ||
InstConflict: | ||
StartDepend: | ||
StartConflict: | ||
CenterType: | ||
UserControl: | ||
MinFWVer: | ||
MaxFWVer: | ||
IndividualFlag: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
[ -f /tmp/debug_apkg ] && echo "APKG_DEBUG: $0 $@" >> /tmp/debug_apkg | ||
|
||
# DO NOT REMOVE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
APP_NAME="$(basename $(pwd))" | ||
DATE="$(date +"%m%d%Y")" | ||
CWD="$(pwd)" | ||
VERSION="$(awk '/Version/{print $NF}' apkg.rc)" | ||
|
||
echo "Building ${APP_NAME} version ${VERSION}" | ||
|
||
MODELS="WDMyCloudDL4100 WDMyCloudDL2100 MyCloudPR4100 MyCloudPR2100" | ||
|
||
for model in $MODELS; do | ||
../../mksapkg -E -s -m $model > /dev/null | ||
done | ||
|
||
echo "Move binaries" | ||
|
||
RELEASE_DIR="../../packages/${APP_NAME}" | ||
mkdir -p "${RELEASE_DIR}" | ||
find .. -maxdepth 1 -name "*.bin*" -exec rename 's#\('$DATE'\)##' {} \; | ||
mv ../*.bin "${RELEASE_DIR}" | ||
|
||
echo "Bundle sources" | ||
SRC_TAR="${RELEASE_DIR}/${APP_NAME}_src_${VERSION}.tar.gz" | ||
tar -czf $SRC_TAR . | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
[ -f /tmp/debug_apkg ] && echo "APKG_DEBUG: $0 $@" >> /tmp/debug_apkg | ||
|
||
APKG_PATH=$(readlink -f $1) | ||
. ${APKG_PATH}/env | ||
|
||
WEBPATH="/var/www/${APKG_NAME}" | ||
|
||
# remove lib | ||
|
||
# remove web | ||
rm -rf $WEBPATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
APKG_NAME="syncthing" | ||
BINARY="syncthing" | ||
|
||
WEBGUI_ADDR=$(grep -m1 Require /usr/local/apache2/conf/httpd.conf | awk '{print $NF}' | cut -d/ -f1) | ||
PORT=8384 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
[ -f /tmp/debug_apkg ] && echo "APKG_DEBUG: $0 $@" >> /tmp/debug_apkg | ||
|
||
APKG_PATH=$(readlink -f $1) | ||
. ${APKG_PATH}/env | ||
|
||
LOG=/tmp/${APKG_NAME}.log | ||
|
||
echo "INIT linking files from path: ${APKG_PATH}" >> $LOG | ||
|
||
# create directory for the webpage TODO FIX ME | ||
WEBDIR="/var/www/${APKG_NAME}/" | ||
mkdir -p ${WEBDIR} | ||
ln -sf ${APKG_PATH}/web/* ${WEBDIR} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
|
||
[ -f /tmp/debug_apkg ] && echo "APKG_DEBUG: $0 $@" >> /tmp/debug_apkg | ||
|
||
INSTALL_DIR=$(readlink -f $1) | ||
. ${INSTALL_DIR}/env | ||
|
||
NAS_PROG=$(readlink -f $2) | ||
|
||
log=/tmp/debug_apkg | ||
|
||
APKG_PATH="${NAS_PROG}/${APKG_NAME}" | ||
|
||
# move package data | ||
mv ${INSTALL_DIR} ${NAS_PROG} | ||
|
||
# setup secure downloads | ||
if [ ! -e /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 | ||
|
||
PLATFORM=$(uname -m) | ||
if [ "${PLATFORM}" = "x86_64" ]; then | ||
PLATFORM="amd64" | ||
else | ||
PLATFORM="arm" | ||
fi | ||
VERSION="v1.1.0" | ||
|
||
MAINDIR="syncthing-linux-${PLATFORM}-${VERSION}" | ||
PACKAGE="${MAINDIR}.tar.gz" | ||
URL="https://github.com/syncthing/syncthing/releases/download/${VERSION}/${PACKAGE}" | ||
|
||
/usr/bin/wget ${URL} | ||
|
||
[[ ! $? -eq 0 ]] && exit 1 | ||
|
||
tar xf ${PACKAGE} -C ${APKG_PATH} | ||
|
||
[[ ! $? -eq 0 ]] && exit 2 | ||
|
||
rm ${PACKAGE} | ||
|
||
mv ${APKG_PATH}/${MAINDIR} ${APKG_PATH}/${APKG_NAME} | ||
|
||
# TODO: restore config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
[ -f /tmp/debug_apkg ] && echo "APKG_DEBUG: $0 $@" >> /tmp/debug_apkg | ||
|
||
NAS_PROG="/shares/Volume_1/Nas_Prog" | ||
|
||
APKG_MODULE="medusa" | ||
APKG_PATH="${NAS_PROG}/${APKG_MODULE}" | ||
APKG_BACKUP_PATH="${NAS_PROG}/${APKG_MODULE}_backup" | ||
APKG_CONFIG="${APKG_PATH}/settings.conf" | ||
|
||
# backup config files and user settings | ||
if [ -f $APKG_CONFIG ] ; then | ||
# copy config to /tmp | ||
mkdir -p ${APKG_BACKUP_PATH} | ||
mv -f ${APKG_CONFIG} ${APKG_BACKUP_PATH} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
[ -f /tmp/debug_apkg ] && echo "APKG_DEBUG: $0 $@" >> /tmp/debug_apkg | ||
|
||
APKG_PATH=$(readlink -f $1) | ||
. ${APKG_PATH}/env | ||
|
||
rm -rf ${APKG_PATH} | ||
|
||
# remove lib | ||
|
||
# remove web | ||
rm -rf /var/www/${APKG_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
APKG_PATH=$1 | ||
. ${APKG_PATH}/env | ||
|
||
ADDRESS=$(grep -m1 'Require ip' /usr/local/apache2/conf/httpd.conf | awk '{print $NF}' | cut -d/ -f1) | ||
|
||
# disable creation of default folder | ||
export STNODEFAULTFOLDER=0 | ||
|
||
# keep all persistent data in the syncthing home dir | ||
ST_HOME=${APKG_PATH}/var | ||
|
||
# start the binary | ||
${APKG_PATH}/syncthing/syncthing -no-browser -home=${ST_HOME} -gui-address="http://${ADDRESS}:${PORT}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
# stop daemon | ||
APKG_DIR=$(readlink -f $1) | ||
. ${APKG_DIR}/env | ||
|
||
if pidof ${BINARY} > /dev/null ; then | ||
echo "Stopping ${APKG_NAME}" | ||
kill $(pidof ${BINARY}) | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php header("Location: http://{$_SERVER['SERVER_ADDR']}:8384"); ?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.