Skip to content

Commit

Permalink
Add memcached/connect.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki777 committed Sep 24, 2024
1 parent 7a42011 commit fe3bac8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions memcached/connect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -eu

currentDir="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
cd $currentDir
. functions.sh

optName=$1

exitIfNotExistVersion "$optName"
optVersion=$(getVersionByName "$optName")

exitIfNotExistPortFile "$optName" "$optVersion"
optPort=$(getPortByName "$optName" "$optVersion")

installDir=$(getInstallDir $(getType))
dir=$installDir/versions/$optVersion

exitIfNotExistDir $dir/datadir/$optName
exitIfNotRunningPort $optPort

echo "You can connect to the server by executing the following command."
echo "telnet 127.0.0.1 $optPort"

0 comments on commit fe3bac8

Please sign in to comment.