33 lines
801 B
Plaintext
33 lines
801 B
Plaintext
#!/usr/bin/openrc-run
|
|
#KhomyaK_HTF
|
|
#Donetsk, 2023
|
|
#My Discord: "DoveLike#0947"
|
|
|
|
description="Hamachi deamon."
|
|
depend() {
|
|
need netmount
|
|
use NetworkManager
|
|
}
|
|
|
|
start() {
|
|
yesno "${IN_BACKGROUND}" && return 0
|
|
|
|
[ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1"
|
|
|
|
ebegin "Starting Hamachi"
|
|
start-stop-daemon --start --exec /opt/logmein-hamachi/bin/hamachid
|
|
local _retval=$?
|
|
eend "${_retval}"
|
|
if [ "x${_retval}" = 'x0' ] && ! nm-online -t "${INACTIVE_TIMEOUT}"; then
|
|
einfo "Marking Hamachi as inactive. It will automatically be marked"
|
|
einfo "as running before the network connection was established."
|
|
mark_service_inactive
|
|
fi
|
|
return "${_retval}"
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping Hamachi"
|
|
killall "/opt/logmein-hamachi/bin/hamachid"
|
|
}
|