Import some files and transform to working containers for:

* mysql
* lighttpd (with php and mysql)
* transmission
* sabnzbd
* sickbeard
* couchpotato
* headphones
* btsync
This commit is contained in:
2015-01-14 15:17:36 +00:00
parent ecb0bb0815
commit a307062d5b
81 changed files with 635 additions and 94 deletions

View File

@@ -1,9 +1,3 @@
#!/bin/sh
mkdir -p $BTSYNC_DATA
if [ ! -e $BTSYNC_CONFIG ]; then
mkdir -p `dirname $BTSYNC_CONFIG`
/opt/btsync --dump-sample-config > $BTSYNC_CONFIG
sed -i 's,\("listening_port"\s*:\)\s*[0-9]\+,\1 5555,' $BTSYNC_CONFIG
sed -i "s,\(\"storage_path\"\s*:\).*,\1 \"$BTSYNC_DATA\"\,," $BTSYNC_CONFIG
fi
/opt/btsync --nodaemon --config $BTSYNC_CONFIG
set -e
/opt/btsync --nodaemon --config $BTSYNC_CONFIG

3
build/runit/couchpotato Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
set -e
/opt/CouchPotatoServer/CouchPotato.py --config_file $COUCHPOTATO_CONFIG --data_dir $COUCHPOTATO_DATA

View File

@@ -1,2 +1,3 @@
#!/bin/sh
/usr/sbin/cron -f
set -e
/usr/sbin/cron -f

View File

@@ -4,4 +4,4 @@ if [ -z "$GMRENDER_NAME" ]; then
/usr/local/bin/gmediarender
else
/usr/local/bin/gmediarender -f $GMRENDER_NAME
fi
fi

View File

@@ -1,4 +1,5 @@
#!/bin/sh
set -e
/opt/logmein-hamachi/bin/hamachid -c $HAMACHI_DATA
strace -qqe '' -p `pgrep hamachid`
/host/bin/proxy

3
build/runit/headphones Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
set -e
python /opt/headphones/Headphones.py --config=$HEADPHONES_CONFIG --datadir=$HEADPHONES_DATA

View File

@@ -1,7 +1,4 @@
#!/bin/bash
mkdir -p `dirname $LIGHTTPD_LOG` $LIGHTTPD_DOMAINS
chown www-data:www-data `dirname $LIGHTTPD_LOG`
if [[ ! -e $LIGHTTPD_DOMAINS ]]; then
touch $LIGHTTPD_DOMAINS/empty.conf
fi
/usr/sbin/lighttpd -D -f $LIGHTTPD_CONFIG
set -e
mkdir -p `dirname $LIGHTTPD_LOG`
/usr/local/sbin/lighttpd -D -f $LIGHTTPD_CONFIG

3
build/runit/lighttpd-php Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
set -e
/usr/local/bin/php-cgi -b 127.0.0.1:$PHP_CGI_PORT -c $PHP_CONFIG

View File

@@ -1,4 +1,5 @@
#!/bin/sh
set -e
if [ ! -f $MINIDLNA_CONFIG ]; then
mkdir -p `dirname $$MINIDLNA_CONFIG`
cp /opt/minidlna-$MINIDLNA_VERSION/minidlna.conf $MINIDLNA_CONFIG

View File

@@ -1,18 +1,9 @@
#!/bin/bash
set -m
echo "$HOST_ADDR host" >> /tmp/hosts
set -e
mkdir -p `dirname $MYSQL_LOG`
if [ ! -d $MYSQL_DATA ]; then
mkdir `dirname $MYSQL_DATA`
cp /var/lib/mysql/ $MYSQL_DATA -R
chown mysql:mysql $MYSQL_DATA -R
MYSQL_SETUP=true
fi
/usr/bin/mysqld_safe --skip-syslog &
if [[ -n "$MYSQL_SETUP" ]]; then
until [[ -n $(netstat -an | grep 3306) ]]; do
sleep 1
done
mysqladmin -u root password dummy
fg
fi
/usr/bin/mysqld_safe --skip-syslog

View File

@@ -1,3 +1,4 @@
#!/bin/bash
set -e
socat TCP-LISTEN:8888,fork TCP:host:8888 &
socat TCP-LISTEN:80,fork,crlf SYSTEM:"echo HTTP/1.0 200; echo Content-Type: text/plain; echo;" &

View File

@@ -1,5 +1,6 @@
#!/bin/sh
set -e
mkdir -p `dirname $REDIS_LOG` $REDIS_DATA
sysctl vm.overcommit_memory=1
/usr/bin/redis-server $REDIS_CONFIG
#/opt/redis-$VERSION/src/redis-server $REDIS_CONFIG
#/opt/redis-$VERSION/src/redis-server $REDIS_CONFIG

4
build/runit/sabnzbd Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
ADDR=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}'`
sabnzbdplus -f $SABNZBD_CONFIG -s $ADDR

3
build/runit/sickbeard Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
set -e
/opt/Sick-Beard/SickBeard.py --config=$SICKBEARD_CONFIG --datadir=$SICKBEARD_DATA

View File

@@ -1,2 +1,3 @@
#!/bin/sh
/usr/sbin/sshd -D
set -e
/usr/sbin/sshd -D

View File

@@ -1,10 +1,6 @@
#!/bin/sh
set -e
SYSLOGNG_OPTS=""
[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng
case "x$CONSOLE_LOG_LEVEL" in
x[1-8])
dmesg -n $CONSOLE_LOG_LEVEL
@@ -15,10 +11,8 @@ case "x$CONSOLE_LOG_LEVEL" in
echo "CONSOLE_LOG_LEVEL is of unaccepted value."
;;
esac
if [ ! -e /dev/xconsole ]
then
mknod -m 640 /dev/xconsole p
fi
syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS
syslog-ng -F -p /var/run/syslog-ng.pid

4
build/runit/transmission Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
mkdir -p `dirname $TRANSMISSION_LOG`
transmission-daemon -f -g $TRANSMISSION_CONFIG -e $TRANSMISSION_LOG --log-error

View File

@@ -1,4 +1,5 @@
#!/bin/sh
set -e
if [ ! -f $UPNPPROXY_CONFIG ]; then
mkdir -p `dirname $UPNPPROXY_CONFIG`
cp /opt/upnpproxy/doc/upnpproxy.conf $UPNPPROXY_CONFIG