From: | "Markos Chandras (hwoarang)" <hwoarang@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in net-misc/logmein-hamachi/files: logmein-hamachi.initd logmein-hamachi.confd |
Date: | Sat, 15 Jan 2011 21:13:35 |
Message-Id: | 20110115211325.74A7E20057@flycatcher.gentoo.org |
1 | hwoarang 11/01/15 21:13:25 |
2 | |
3 | Added: logmein-hamachi.initd logmein-hamachi.confd |
4 | Log: |
5 | Initial commit of new hamachi client. Bug #350172. Thanks to Simone Scanzoni <nonno.cicala@××××××.it> for the ebuilds and scripts. |
6 | |
7 | (Portage version: 2.1.9.31/cvs/Linux x86_64) |
8 | |
9 | Revision Changes Path |
10 | 1.1 net-misc/logmein-hamachi/files/logmein-hamachi.initd |
11 | |
12 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/logmein-hamachi/files/logmein-hamachi.initd?rev=1.1&view=markup |
13 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/logmein-hamachi/files/logmein-hamachi.initd?rev=1.1&content-type=text/plain |
14 | |
15 | Index: logmein-hamachi.initd |
16 | =================================================================== |
17 | #!/sbin/runscript |
18 | # Copyright 1999-2011 Gentoo Foundation |
19 | # Distributed under the terms of the GNU General Public License v2 |
20 | |
21 | DAEMON=/opt/logmein-hamachi/bin/hamachid |
22 | PIDFILE=/var/run/logmein-hamachi/hamachid.pid |
23 | |
24 | depend() { |
25 | need net |
26 | } |
27 | |
28 | start() |
29 | { |
30 | # returns |
31 | # 0 if daemon has been started |
32 | # 1 if daemon was already running |
33 | # 2 if daemon could not be started |
34 | |
35 | ebegin "Starting hamachi" |
36 | |
37 | start-stop-daemon --quiet --start --exec "${DAEMON}" \ |
38 | --pidfile "${PIDFILE}" -- -c "${CONFDIR}" |
39 | result=$? |
40 | |
41 | if [ ${result} -eq 0 ] && [ -n "${NICKNAME}" ]; then |
42 | # it fails logging in immediately |
43 | sleep ${WAIT} |
44 | /usr/bin/hamachi login |
45 | if [ -z "$(/usr/bin/hamachi | grep 'logged in')" ]; then |
46 | start-stop-daemon --quiet --stop \ |
47 | --exec "${DAEMON}" --pidfile "${PIDFILE}" |
48 | result=1 |
49 | else |
50 | /usr/bin/hamachi set-nick "${NICKNAME}" |
51 | fi |
52 | fi |
53 | |
54 | eend ${result} |
55 | } |
56 | |
57 | stop() |
58 | { |
59 | # returns |
60 | # 0 if daemon has been stopped |
61 | # 1 if daemon was already stopped |
62 | # 2 if daemon could not be stopped |
63 | # other if a failure occurred |
64 | |
65 | ebegin "Stopping hamachi" |
66 | |
67 | /usr/bin/hamachi logout >> /dev/null |
68 | start-stop-daemon --quiet --stop --exec "${DAEMON}" \ |
69 | --pidfile "${PIDFILE}" |
70 | |
71 | eend $? |
72 | } |
73 | |
74 | |
75 | |
76 | 1.1 net-misc/logmein-hamachi/files/logmein-hamachi.confd |
77 | |
78 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/logmein-hamachi/files/logmein-hamachi.confd?rev=1.1&view=markup |
79 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/logmein-hamachi/files/logmein-hamachi.confd?rev=1.1&content-type=text/plain |
80 | |
81 | Index: logmein-hamachi.confd |
82 | =================================================================== |
83 | # Copyright 1999-2011 Gentoo Foundation |
84 | # Distributed under the terms of the GNU General Public License v2 |
85 | # $Header: /var/cvsroot/gentoo-x86/net-misc/logmein-hamachi/files/logmein-hamachi.confd,v 1.1 2011/01/15 21:13:25 hwoarang Exp $ |
86 | |
87 | # /etc/conf.d/logmein-hamachi |
88 | # Config file for logmein-hamachi control script |
89 | |
90 | # Location of config, identity and log files |
91 | CONFDIR="/var/lib/logmein-hamachi" |
92 | |
93 | # Your nickname |
94 | # Set it to enable auto-login when starting the service |
95 | NICKNAME="" |
96 | |
97 | # Seconds to wait before auto-login (if enabled) |
98 | WAIT="2" |