-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d79e829
Showing
15 changed files
with
1,227 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,6 @@ | ||
addon_tmp | ||
dist | ||
.idea | ||
.DS_Store | ||
live | ||
CHANGELOG.md |
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,15 @@ | ||
# ccu-addon-redis | ||
|
||
[![Current Release](https://img.shields.io/github/release/hobbyquaker/ccu-addon-redis.svg?colorB=4cc61e)](https://github.com/hobbyquaker/ccu-addon-redis/releases/latest) | ||
[![Github Releases](https://img.shields.io/github/downloads/hobbyquaker/ccu-addon-redis/total.svg)](https://github.com/hobbyquaker/ccu-addon-redis/releases) | ||
|
||
[redis](https://redis.io/) als Addon für die | ||
[Homematic CCU3](https://www.eq-3.de/produkte/homematic/zentralen-und-gateways/smart-home-zentrale-ccu3.html) und | ||
[RaspberryMatic](https://github.com/jens-maus/RaspberryMatic) | ||
|
||
Unter [Releases](https://github.com/hobbyquaker/ccu-addon-redis/releases) steht die Datei | ||
`redis-<version>.tar.gz` zum Download zur Verfügung, diese kann über das CCU WebUI als Zusatzsoftware installiert | ||
werden. | ||
|
||
Eigene Konfigurationen können in `/usr/local/addons/redis/etc/local.conf` vorgenommen werden, der Inhalt dieser Datei | ||
wird bei Updates nicht überschrieben. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
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,56 @@ | ||
#!/bin/sh | ||
|
||
CONF_DIR=/usr/local/etc/config | ||
ADDON_DIR=/usr/local/addons/redis | ||
|
||
BIN_DIR=/usr/local/bin | ||
CONF_DIR=/usr/local/etc/config | ||
|
||
Stop () { | ||
echo -n "Stopping redis: " | ||
killall redis-server && echo "OK" | ||
} | ||
|
||
Start () { | ||
echo -n "Starting redis: " | ||
$ADDON_DIR/bin/redis-server $ADDON_DIR/etc/redis.conf && echo "OK" | ||
} | ||
|
||
case "$1" in | ||
|
||
stop) | ||
Stop | ||
;; | ||
|
||
start) | ||
Start | ||
;; | ||
|
||
restart) | ||
Stop | ||
sleep 3 | ||
Start | ||
;; | ||
|
||
info) | ||
echo "Info: <center><a href=\"https://redis.io/\" target=\"_blank\"><img width=\"240\" src="/addons/redis/redis.png"></a></center>" | ||
echo "Name: redis" | ||
echo "Version: 3.2.11+0" | ||
echo "Update: /addons/redis/update_check.cgi" | ||
echo "Operations: uninstall" | ||
;; | ||
|
||
uninstall) | ||
/usr/bin/killall redis-server | ||
rm $CONF_DIR/rc.d/redis | ||
rm $BIN_DIR/redis* | ||
rm $CONF_DIR/addons/www/redis | ||
rm -r $ADDON_DIR | ||
;; | ||
|
||
*) | ||
echo "Usage: redis {start|stop|restart|info|uninstall}" >&2 | ||
exit 1 | ||
;; | ||
|
||
esac |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
#!/usr/bin/env tclsh | ||
|
||
set checkURL "https://api.github.com/repos/hobbyquaker/ccu-addon-redis/releases/latest" | ||
set downloadURL "https://github.com/hobbyquaker/ccu-addon-redis/releases/latest" | ||
|
||
catch { | ||
set input $env(QUERY_STRING) | ||
set pairs [split $input &] | ||
foreach pair $pairs { | ||
if {0 != [regexp "^(\[^=]*)=(.*)$" $pair dummy varname val]} { | ||
set $varname $val | ||
} | ||
} | ||
} | ||
|
||
if { [info exists cmd ] && $cmd == "download"} { | ||
puts "<html><head><meta http-equiv='refresh' content='0; url=$downloadURL' /></head></html>" | ||
} else { | ||
catch { | ||
[regexp "tag_name\": \"v?(\[0-9\]+\.\[0-9\]+\.\[0-9\]+.\[0-9\]+)" [ exec /usr/bin/env wget -qO- --no-check-certificate $checkURL ] dummy newversion] | ||
} | ||
if { [info exists newversion] } { | ||
puts -nonewline $newversion | ||
} else { | ||
puts -nonewline "n/a" | ||
} | ||
} |
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,36 @@ | ||
#!/bin/sh | ||
|
||
ADDONS_DIR=/usr/local/addons | ||
REDIS_DIR=$ADDONS_DIR/redis | ||
|
||
|
||
BIN_DIR=/usr/local/bin | ||
LIB_DIR=/usr/local/lib | ||
CONF_DIR=/usr/local/etc/config | ||
|
||
mount | grep /usr/local 2>&1 >/dev/null | ||
if [ $? -eq 1 ]; then | ||
mount /usr/local | ||
fi | ||
|
||
mkdir -p $ADDONS_DIR && chmod 755 $ADDONS_DIR | ||
mkdir -p $BIN_DIR && chmod 755 $BIN_DIR | ||
mkdir -p $LIB_DIR && chmod 755 $LIB_DIR | ||
|
||
if [ -f $CONF_DIR/rc.d/redis ]; then | ||
$CONF_DIR/rc.d/redis stop | ||
fi | ||
|
||
cp -af redis $ADDONS_DIR/ | ||
|
||
if [ ! -f $REDIS_DIR/etc/local.conf ]; then | ||
touch $REDIS_DIR/etc/local.conf | ||
fi | ||
|
||
ln -sf $REDIS_DIR/bin/* /usr/local/bin/ | ||
ln -sf $REDIS_DIR/rc.d/redis $CONF_DIR/rc.d/redis | ||
ln -sf $REDIS_DIR/www $CONF_DIR/addons/www/redis | ||
|
||
sync | ||
|
||
exit 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,33 @@ | ||
#!/bin/bash | ||
|
||
BUILD_DIR=`cd ${0%/*} && pwd -P` | ||
|
||
ADDON_FILES=$BUILD_DIR/addon_files | ||
ADDON_TMP=$BUILD_DIR/addon_tmp | ||
|
||
mkdir $ADDON_TMP 2> /dev/null || rm -r $ADDON_TMP/* | ||
|
||
echo "copying files to tmp dir..." | ||
cp -r $ADDON_FILES/* $ADDON_TMP/ | ||
|
||
cd $BUILD_DIR | ||
|
||
|
||
ADDON_FILE=redis-3.2.11+0.tar.gz | ||
echo "compressing addon package $ADDON_FILE ..." | ||
|
||
mkdir $BUILD_DIR/dist 2> /dev/null | ||
cd $ADDON_TMP | ||
cd $ADDON_TMP | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
if [[ -f /usr/local/bin/gtar ]]; then | ||
gtar --exclude=.DS_Store --owner=root --group=root -czf $BUILD_DIR/dist/$ADDON_FILE * | ||
else | ||
tar --exclude=.DS_Store -czf $BUILD_DIR/dist/$ADDON_FILE * | ||
fi | ||
else | ||
tar --owner=root --group=root -czf $BUILD_DIR/dist/$ADDON_FILE * | ||
fi | ||
cd $BUILD_DIR | ||
|
||
echo "done." |