Skip to content

Commit

Permalink
update redis
Browse files Browse the repository at this point in the history
  • Loading branch information
harper-yang committed Dec 31, 2019
1 parent 0d75824 commit 4990d30
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
Binary file added redis/redis-2.8.24.tar.gz
Binary file not shown.
28 changes: 27 additions & 1 deletion redis/redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,29 @@ done
echo ok
}

Status_C() {
echo "start num"
read num1
echo "end num"
read num2
echo -en "\n"
n=$num1
port_array=$(netstat -nltp | sed -n '/^tcp6.*redis-server/p' | awk '{print $4}' | awk -F ':' '{print $4}')

for ((n=$num1;n<=$num2;n++))
do
if [[ "${port_array[@]}" =~ "$n" ]];
then echo "port:$n,start success.."
else
echo "port:$n,start failure.."
fi
done;



}


case "$1" in
start)
Start_C
Expand All @@ -71,8 +94,11 @@ Install_C
uninstall)
Uninstall_A
;;
status)
Status_C
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|install|uninstall}" >&2
exit 3
;;
esac
esac
7 changes: 7 additions & 0 deletions redis/tmp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 12388/redis-server
tcp 0 0 0.0.0.0:6380 0.0.0.0:* LISTEN 12395/redis-server
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1199/sshd
tcp6 0 0 :::6379 :::* LISTEN 12388/redis-server
tcp6 0 0 :::6380 :::* LISTEN 12395/redis-server

0 comments on commit 4990d30

Please sign in to comment.