From e735f83cb731a10666772dd24bbf9cb0e5d532d6 Mon Sep 17 00:00:00 2001 From: milisarge Date: Fri, 31 Mar 2017 23:00:23 +0300 Subject: [PATCH] nbd.paketlendi --- talimatname/genel/nbd/allow | 7 +++++++ talimatname/genel/nbd/nbd-server | 28 ++++++++++++++++++++++++++++ talimatname/genel/nbd/talimat | 24 ++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 talimatname/genel/nbd/allow create mode 100644 talimatname/genel/nbd/nbd-server create mode 100644 talimatname/genel/nbd/talimat diff --git a/talimatname/genel/nbd/allow b/talimatname/genel/nbd/allow new file mode 100644 index 000000000..9af1ff475 --- /dev/null +++ b/talimatname/genel/nbd/allow @@ -0,0 +1,7 @@ +# nbd-server access configuration file +# list of hosts allowed to connect to our exportet +# + +#127.0.0.1 +# CIDR notation is allowed also +#192.168.0.0/8 diff --git a/talimatname/genel/nbd/nbd-server b/talimatname/genel/nbd/nbd-server new file mode 100644 index 000000000..bb85e72f3 --- /dev/null +++ b/talimatname/genel/nbd/nbd-server @@ -0,0 +1,28 @@ +#!/bin/sh +# +# /etc/rc.d/init.d/nbd-server: start/stop nbd daemon +# + +case $1 in +start) + /usr/bin/nbd-server -p /var/run/nbd-server.pid -l /etc/nbd-server/allow + ;; +stop) + if [ -f /var/run/nbd-server.pid ]; then + kill `cat /var/run/nbd-server.pid` + rm -f /var/run/nbd-server.pid + else + killall -q /usr/sbin/nbd-server + fi + ;; +restart) + $0 stop + sleep 2 + $0 start + ;; +*) + echo "kullanim: $0 [start|stop|restart]" + ;; +esac + +# End of file diff --git a/talimatname/genel/nbd/talimat b/talimatname/genel/nbd/talimat new file mode 100644 index 000000000..4219794d9 --- /dev/null +++ b/talimatname/genel/nbd/talimat @@ -0,0 +1,24 @@ +# Description: Blok cihazlarının NBD protokolüyle paylaşma ve kullanma +# URL: http://nbd.sourceforge.net/ +# Maintainer: milisarge +# Depends on: gnutls glib + +name=nbd +version=3.15.2 +release=1 +source=(http://downloads.sourceforge.net/project/nbd/nbd/$version/$name-$version.tar.xz + nbd-server + allow) + +build() { + cd $name-$version + ./configure --prefix=/usr \ + --mandir=/usr/man \ + --sysconfdir=/etc + make + make DESTDIR=$PKG install + install -d $PKG/etc/nbd-server + install -D -m 600 $SRC/allow $PKG/etc/nbd-server/allow + install -D -m 755 $SRC/nbd-server $PKG/etc/rc.d/init.d/nbd-server + +}