X-Original-To: alpine-aports@lists.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from apollo.thewebhostserver.com (apollomail.thewebhostserver.com [46.23.65.248]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 1E109DC0092 for ; Fri, 6 Feb 2015 17:31:00 +0000 (UTC) Received: from [81.4.121.188] (port=52715 helo=localhost.localdomain) by apollo.thewebhostserver.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.84) (envelope-from ) id 1YJmk3-003fyh-V3; Fri, 06 Feb 2015 17:30:56 +0000 From: Stuart Cardall To: alpine-aports@lists.alpinelinux.org Cc: Stuart Cardall Subject: [alpine-aports] [PATCH] main/sshfs: add /sbin/setup-sshfs Date: Fri, 6 Feb 2015 17:30:37 +0000 Message-Id: <1423243837-4739-1-git-send-email-developer@it-offshore.co.uk> X-Mailer: git-send-email 2.2.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - apollo.thewebhostserver.com X-AntiAbuse: Original Domain - lists.alpinelinux.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - it-offshore.co.uk X-Get-Message-Sender-Via: apollo.thewebhostserver.com: authenticated_id: developer@it-offshore.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: revised patch with the setup script moved to /sbin --- main/sshfs/APKBUILD | 16 ++++++++++++---- main/sshfs/sshfs.setup | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 main/sshfs/sshfs.setup diff --git a/main/sshfs/APKBUILD b/main/sshfs/APKBUILD index 6b3c3b4..8727b06 100644 --- a/main/sshfs/APKBUILD +++ b/main/sshfs/APKBUILD @@ -8,7 +8,9 @@ arch="all" license="GPL" depends="openssh-client" makedepends="pkgconfig fuse-dev glib-dev" -source="http://downloads.sourceforge.net/sourceforge/fuse/sshfs-fuse-$pkgver.tar.gz" +source="http://downloads.sourceforge.net/sourceforge/fuse/sshfs-fuse-$pkgver.tar.gz + $pkgname.setup + " _builddir="$srcdir"/sshfs-fuse-$pkgver build () @@ -25,8 +27,14 @@ build () package() { cd "$_builddir" make DESTDIR="$pkgdir" install || return 1 + install -m755 -D "$srcdir"/$pkgname.setup \ + "$pkgdir"/sbin/setup-$pkgname || return 1 + } -md5sums="17494910db8383a366b1301e5f5148a9 sshfs-fuse-2.5.tar.gz" -sha256sums="e9171452e5d0150b9c6a2158fd2e2dcefb5d5d03ba4d208949e00a3a46c6e63e sshfs-fuse-2.5.tar.gz" -sha512sums="48ae4008d10fe66b843ff1e891627f8262e00d064fec048c8c1189507e757994e81e4fa2deb4d8d56cff0d1818efe4a692494b9c48a01c6c79c626acefa1b53e sshfs-fuse-2.5.tar.gz" +md5sums="17494910db8383a366b1301e5f5148a9 sshfs-fuse-2.5.tar.gz +006b92e3a95f7156e3f8f99493262d01 sshfs.setup" +sha256sums="e9171452e5d0150b9c6a2158fd2e2dcefb5d5d03ba4d208949e00a3a46c6e63e sshfs-fuse-2.5.tar.gz +96722ab9c7cb961266d4f684ea3e3b53e3fcddd513f7273c7a29cd6af69e1b23 sshfs.setup" +sha512sums="48ae4008d10fe66b843ff1e891627f8262e00d064fec048c8c1189507e757994e81e4fa2deb4d8d56cff0d1818efe4a692494b9c48a01c6c79c626acefa1b53e sshfs-fuse-2.5.tar.gz +4bfaa2d9da94a09c4c7f6f93242f5ff503beb4b273df14e39ae14eb0902d0b92a0359395c2674d8c5c0ecf077ee6ab70c93b6497947e53d0972c58f8f8e6c5e9 sshfs.setup" diff --git a/main/sshfs/sshfs.setup b/main/sshfs/sshfs.setup new file mode 100644 index 0000000..e89d5bc --- /dev/null +++ b/main/sshfs/sshfs.setup @@ -0,0 +1,29 @@ +#!/bin/sh + +NORMAL="\033[1;0m" +STRONG="\033[1;1m" +GREEN="\033[1;32m" + +print_strong() { + local prompt="${STRONG}$1 ${GREEN}$2${NORMAL}" + printf "${prompt} %s" +} + +user_list=$(awk -F':' '{ if ( $3 >= 1000 && $1 != "nobody" ) print $1}' /etc/passwd) +group=readproc + +if [ -n "$user_list" ]; then + print_strong "\nAdd normal system users to group '$group'" "(to allow sshfs mounting) [y/N]:" + read answer + + case "$answer" in + y*|Y*) for user in $user_list; do + read -p "Add '$user' to Group '$group'?: [y/N] " answer + case "$answer" in + y*|Y*) addgroup $user $group;; + esac + done;; + esac +fi +exit 0 + -- 2.2.2 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---