Last active
December 12, 2015 10:39
-
-
Save taka3110/4760825 to your computer and use it in GitHub Desktop.
開発環境を分けた時のmemcacheをコントロールするスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PNAME=memcached | |
PPORT=11211 | |
case $1 in | |
start) sudo /etc/init.d/$PNAME start ;; | |
stop) sudo /etc/init.d/$PNAME stop ;; | |
restart) sudo /etc/init.d/$PNAME restart ;; | |
stats) | |
sudo echo "sleep 1;echo stats" > /tmp/$PNAME.sh | |
sudo sh /tmp/$PNAME.sh | telnet localhost $PPORT | |
rm -f /tmp/$PNAME.sh | |
;; | |
clear) | |
sudo echo "sleep 1;echo flush_all" > /tmp/$PNAME.sh | |
sudo sh /tmp/$PNAME.sh | telnet localhost $PPORT | |
rm -f /tmp/$PNAME.sh | |
;; | |
*) | |
echo "Usage: $N {start|stop|restart|stats|clear}" >&2 | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment