Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:infi777:serverbox
mldonkey-service
mlnet_sendcommand
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mlnet_sendcommand of Package mldonkey-service
#!/bin/sh # MLDonkey / MLNet - Send a command to local server thisName=$(basename $0) usage(){ echo "Usage: ${thisName} [--auth '<user> <passwd>' | --auth-keyfile <keyfile>] <mldonkey command>" echo " where <keyfile> contains <user> <passwd>" } case "$1" in "--help"|"-h") usage; exit 0;; esac # Defaults MLNET_HOME="/var/lib/mldonkey" MLNET_LOGDIR="/var/log/mldonkey" # Sysconfig [ -e /etc/sysconfig/mldonkey ] && source /etc/sysconfig/mldonkey LOGFILE="${MLNET_LOGDIR}/sendcommand.log" MLNET_HOST=127.0.0.1 MLNET_TELNET_PORT=4000 AUTH="" logThis(){ echo -e "$(date +%Y%m%d-%H%M%S)] $@" >> ${LOGFILE} } logThis "ARGS: $@" while [ $# -gt 0 ]; do case "$1" in "--auth") AUTH="auth $2"; shift;; "--auth-keyfile") AUTH="auth $(cat "$2")\n"; shift;; *) break;; esac shift done NETCAT=/usr/bin/netcat if [ -x $NETCAT ]; then echo -e "${AUTH}$*\nq\n" | $NETCAT -q 1 $MLNET_HOST $MLNET_TELNET_PORT > /dev/null exit 0 else echo "Error: $NETCAT not available." exit 1 fi #eof
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor