소스 검색

Add a judgment on whether the tomcat-user can be logged in

Kizureina 2 년 전
부모
커밋
c9101f440b
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      init.d/Tomcat-init

+ 6 - 2
init.d/Tomcat-init

@@ -86,8 +86,12 @@ stop() {
 }
 
 user_exists() {
-  if id -u $1 >/dev/null 2>&1; then
-    echo "1"
+  if [ "`cat /etc/passwd | grep ftp | cut -d ":" -f7 | cut -d "/" -f4`" = "nologin" ]; then
+    if id -u $1 >/dev/null 2>&1; then
+      echo "1"
+    else
+      echo "0"
+    fi
   else
     echo "0"
   fi