2018. 11. 1. 11:31

웹 서비스용 사설 SSL 인증서 만들기


1. RootCA 인증서 카 생성 (RSA)

#> openssl genrsa -aes256 -out /home/Kimos/WebSSL/kimos-rootca.key 2048

Generating RSA private key, 2048 bit long modulus

..............................+++

.....................................................+++

e is 65537 (0x10001)

Enter pass phrase for /home/Kimos/WebSSL/kimos-rootca.key:

Verifying - Enter pass phrase for /home/Kimos/WebSSL/kimos-rootca.key:


2. RootCA 인증서 생성을 위한 환결 설정 파일 생성

#> vim kimos-rootca.conf

[ req ]

default_bits                    = 2048

default_md                      = sha1

default_keyfile                 = kimos-rootca.key

distinguished_name              = req_distinguished_name

extensions                      = v3_ca

req_extensions                  = v3_ca


[ v3_ca ]

basicConstraints                = critical, CA:TRUE, pathlen:0

subjectKeyIdentifier            = hash

##authorityKeyIdentifier        = keyid:always, issuer:always

keyUsage                        = keyCertSign, cRLSign

nsCertType                      = sslCA, emailCA, objCA


[req_distinguished_name ]

countryName                     = Country Name (2 letter code)

countryName_default             = KR

countryName_min                 = 2

countryName_max                 = 2


# 회사명 입력

organizationName                = Organization Name (eg, company)

organizationName_default      = KimosWork


# SSL 서비스할 domain 명 입력

commonName                      = Common Name (eg, your name or your server's hostname)

commonName_default            = ssl.kimos.com

commonName_max                  = 64


3. RootCA 인증서 생성 요청

#> openssl req -new -key /home/Kimos/WebSSL/kimos-rootca.key -out /home/Kimos/WebSSL/kimos-rootca.csr -config kimos-rootca.conf

Enter pass phrase for /home/Kimos/WebSSL/kimos-rootca.key:

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter '.', the field will be left blank.

-----

Country Name (2 letter code) [KR]:

Organization Name (eg, company) [KimosWork]:

Common Name (eg, your name or your servers hostname) [ssl.kimos.com]:


4. 인증 기간 10년 self-signed RootCA 인증서 생성

#> openssl x509 -req -days 3650 -extensions v3_ca -set_serial 1 \

-in /home/Kimos/WebSSL/kimos-rootca.csr \

-signkey /home/Kimos/WebSSL/kimos-rootca.key \

-out /home/Kimos/WebSSL/kimos-rootca.crt \

-extfile kimos-rootca.conf

Signature ok

subject=/C=KR/O=KimosWork/CN=ssl.kimos.com

Getting Private key

Enter pass phrase for /home/Kimos/WebSSL/kimos-rootca.key: 


5. RootCA 인증서 생성 확인

#> openssl x509 -text -in /home/Kimos/WebSSL/kimos-rootca.crt


6. SSL 인증서 RSA 키 생성

#> openssl genrsa -aes256 -out /home/Kimos/WebSSL/kimos-ssl.key 2048

Generating RSA private key, 2048 bit long modulus

...............................+++

..............+++

e is 65537 (0x10001)

Enter pass phrase for /home/Kimos/WebSSL/kimos-ssl.key:

Verifying - Enter pass phrase for /home/Kimos/WebSSL/kimos-ssl.key:


7. SSL 인증서 생성을 위한 환결 설정 파일 생성

#> vim kimos-ssl.conf

[ req ]

default_bits            = 2048

default_md              = sha1

default_keyfile         = kimos-rootca.key

distinguished_name      = req_distinguished_name

extensions              = v3_user


[ v3_user ]

basicConstraints = CA:FALSE

authorityKeyIdentifier = keyid,issuer

subjectKeyIdentifier = hash

keyUsage = nonRepudiation, digitalSignature, keyEncipherment

extendedKeyUsage = serverAuth,clientAuth

subjectAltName = @alt_names


[ alt_names]

DNS.1   = ssl.kimos.com

#DNS.2   = kimos.com

#DNS.3   = *.kimos.com


[req_distinguished_name ]

countryName                     = Country Name (2 letter code)

countryName_default             = KR    

countryName_min                 = 2

countryName_max                 = 2


organizationName                = Organization Name (eg, company)

organizationName_default        = KimosWork


organizationalUnitName          = Organizational Unit Name (eg, section)

organizationalUnitName_default  = Solutions R&D Team


# SSL 서비스할 domain 명 입력

commonName                      = Common Name (eg, your name or your server's hostname)

commonName_default              = ssl.kimos.com

commonName_max                  = 64


8. SSL 인증서 생성 요청

#> openssl req -new -key /home/Kimos/WebSSL/kimos-ssl.key -out /home/Kimos/WebSSL/kimos-ssl.csr -config kimos-ssl.conf

Enter pass phrase for /home/Kimos/WebSSL/kimos-ssl.key:

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter '.', the field will be left blank.

-----

Country Name (2 letter code) [KR]:

Organization Name (eg, company) [KimosWork]:

Organizational Unit Name (eg, section) [Solutions R&D Team]:

Common Name (eg, your name or your servers hostname) [ssl.kimos.com]:


9. 인증 기간 10년 self-signed SSL 인증서 생성

#> openssl x509 -req -days 3650 -extensions v3_user \

-in /home/Kimos/WebSSL/kimos-ssl.csr \

-CA /home/Kimos/WebSSL/kimos-rootca.crt -CAcreateserial \

-CAkey /home/Kimos/WebSSL/kimos-rootca.key \

-out /home/Kimos/WebSSL/kimos-ssl.crt \

-extfile kimos-ssl.conf

Signature ok

subject=/C=KR/O=KimosWork/OU=Solutions R&D Team/CN=ssl.kimos.com

Getting CA Private Key

Enter pass phrase for /home/Kimos/WebSSL/kimos-rootca.key:


10. SSL 인증서 생성 확인을 위한 인증서 정보 출력

#> openssl x509 -text -in /home/Kimos/WebSSL/kimos-ssl.crt


11. Web에 SSL 인증서 적용을 위한 p12 형식의 파일로 변환

#> openssl pkcs12 -export -in /home/Kimos/WebSSL/kimos-ssl.crt -inkey /home/Kimos/WebSSL/kimos-ssl.key -out kimos-ssl.p12

Enter pass phrase for /home/Kimos/WebSSL/kimos-ssl.key:

Enter Export Password:

Verifying - Enter Export Password:


Posted by Kimos
2015. 2. 3. 11:56

내가 사용하고 있는 화면을 리눅스에 접속하고 있는 다른 사용자에게 공유하고 할 때 사용


간단한 사용법


#> who am i

AAAA    pts/0        2015-02-03 10:21 (1.1.1.1)


#> who

AAAA    pts/0        2015-02-03 10:21 (1.1.1.1)

BBBB    pts/1        2015-02-03 10:38 (2.2.2.2)


#> script /dev/pts/1

.

.

#> who

AAAA    pts/0        2015-02-03 10:21 (1.1.1.1)

BBBB    pts/1        2015-02-03 10:38 (2.2.2.2)

AAAA    pts/3        2015-02-03 10:55


.

.

#> exit


위의 명령어를 사용할 경우, AAAA가 사용하는 명령어 및 실행되고 있는 화면이 BBBB에게도 동일하게 보여진다.


이 경우, BBBB에서 다른 명령어 및 키보드를 입력할 경우 잠시 AAAA에게는 전달 되지 않는다.


AAAA가 script를 이용하여 공유하고 있을 경우, BBBB에서는 작업을 하지 않는 것이 좋다.


작업이 완료된 이후, AAAA에서 exit 명령어를 실행하면 script 작업이 완료된다.


이 외에 script 명령어를 이용하여 자신이 사용한 명령어의 화면은 특정 파일에 LOG를 남기는 것도 가능하다.


설명

 - Script 명령은 터미날에서 보여지는 모든 내용을 파일에 기록한다.  이것은 쉘에서의 사용자와 컴과의 작업 상태를 기록하고, 그것을 다시 살펴 보아야할 경우에 아주 유용하게 쓰인다.  또한 파이프 기능을 이용하여 다른 작업을 하고 있으면서이 기록 내용을 인쇄할 수도 있다.


script 옵션 정리

  1. 파일인자가 있으면, 그 파일에 모든 내용을 기록하고, 없으면, typescript 파일에 기록한다.
  2. a : 지정한 file 혹은 typescript라는 파일이 존재할 경우 파일을 새로 생성하여 저장하는 것이 아니라 추가되어 저장된다.
  3. c : script 실행시 실행될 명령어를 입력한다. 입력한 명령어가 종료되면 script도 종료된다.
  4. f : 사용하는 명령어들이 실시간으로 파일에 저장된다. -f 명령어를 사용하지 않으면 -t 옵션에 설정된 시간에 사용했던 명령어및 화면이 파일에 저장되나 -f 옵션을 사용하면 실시간으로 파일에 저장된다.
  5. q : 조용한 모드 실행 옵션으로, script 실행 시 및 종료 시에 상태 메세지 출력을 생략한다.
  6. t : 스크립트 실행 명령어 및 화면이 파일에 저장되는 시간을 설정한다. 미설정 시 기본값은 30초이다.


#> man script

NAME

script - make typescript of terminal session

SYNOPSIS

script [-a] [-c COMMAND] [-f] [-q] [-t] [file]

DESCRIPTION

Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. Options: -a Append the output to file or typescript, retaining the prior con- tents. -c COMMAND Run the COMMAND rather than an interactive shell. This makes it easy for a script to capture the output of a program that behaves differently when its stdout is not a tty. -f Flush output after each write. This is nice for telecooperation: One person does 'mkfifo foo; script -f foo' and another can supervise real-time what is being done using 'cat foo'. -q Be quiet. -t Output timing data to standard error. This data contains two fields, separated by a space. The first field indicates how much time elapsed since the previous output. The second field indi- cates how many characters were output this time. This information can be used to replay typescripts with realistic typing and out- put delays. The script ends when the forked shell exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the type- script file. Script works best with commands that do not manipulate the screen, the results are meant to emulate a hardcopy terminal.

ENVIRONMENT

The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically).

SEE ALSO

csh(1) (for the history mechanism), scriptreplay(1).

HISTORY

The script command appeared in 3.0BSD.

BUGS

Script places everything in the log file, including linefeeds and 

     backspaces. This is not what the naive user expects.


Posted by Kimos
2014. 5. 8. 12:02
1. 설치 파일 및 버전
 가. httpd-2.4.9
 나. apr-1.5.1
 다. apr-util-1.5.3
 라. pcre-8.35

2. 설치 파일 다운로드
 가. HTTPD 파일 다운로드
   - Apache.org에서 다운로드
   #> wget "http://apache.tt.co.kr//httpd/httpd-2.4.9.tar.gz"

 나. APR(Apache Portable Runtime) 파일 다운로드
   - Apache.org에서 다운로드
   #> wget "http://mirror.apache-kr.org//apr/apr-1.5.1.tar.gz"

 다. APR-UTIL 파일 다운로드
   - Apache.org에서 다운로드
   #> wget "http://mirror.apache-kr.org//apr/apr-util-1.5.3.tar.gz"

 라. APR(Apache Portable Runtime) 파일 다운로드
   - www.pcre.org에서 다운로드
   #> wget "http://sourceforge.net/projects/pcre/files/pcre/8.35/pcre-8.35.tar.gz"

3. 설치
 가. pcre 설치
   #> tar -zxvf pcre-8.35.tar.gz
   #> cd pcre-8.35
   #> ./configure --prefix=/usr/local/pcre
   #> make
   #> make install

 나. apr 설치
   #> tar -zxvf apr-1.5.1.tar.gz
   #> cd apr-1.5.1
   #> ./configure --prefix=/usr/local/apr
   #> make
   #> make install
  ※ configure중 아래의 에러 발생 시,
       rm: cannot remove `libtoolT': No such file or directory
       아래의 명령어 실행 후, 다시 configure 실행
   #> cp -arp libtool libtoolT

 다. apr-util 설치
   #> tar -zxvf apr-util-1.5.3.tar.gz
   #> cd apr-util-1.5.3
   #> ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
   #> make
   #> make install

 라. httpd 설치
   #> tar -zxvf httpd-2.4.9.tar.gz
   #> cd httpd-2.4.9
   #> ./configure \
   --prefix=/usr/local/apache2 \
   --with-apr=/usr/local/apr \
   --with-apr-util=/usr/local/apr-util \
   --with-pcre=/usr/local/pcre \
   --enable-mods-shared=all \
   --enable-so --enable-rewrite
  #> make
  #> make install

※ 설치 순서만 위와 같이 진행하면 특별한 ERROR 없이 설치 가능, 그 외 필요한 라이브러리는 yum으로 설치

4. 설정
 가. httpd.conf 설정
  #> vi /usr/local/apache2/conf/httpd.conf
ServerName localhost <= HOSTNAME 변경
User nobody
Group nobody


Posted by Kimos
2013. 8. 28. 10:32

CentOS에서 Lan Card 변경 및 하드웨어가 추가 및 변경, 또는 제거되었을 경우,


아래의 명령어를 사용하여 적용 시킬수 있다.


아래의 명령어는 Windows 시스템의 PnP 기능을 수행하는 명령어 이다.


$> kudzu

Posted by Kimos
2010. 6. 23. 13:42

Kernel image 압축 해제

1. /boot 밑에 있는 img 파일을 임의 디렉토리에 gzip파일로 확장자를 변경하여 가지고 온다.
#> cp linux-2.6.29.6 /temp/linux-2.6.29.6.gz

2. 이미지 파일을 decompress 시켜준다.
#> cd /temp
#> gzip -d initrd-2.6.29.6.img.gz

3. 이미지의 압축을 풀어준다.
#> cd /temp/tmp
#> cpio -i --make-directories < /temp/initrd-2.6.29.6R1.img

4. 변경 사항을 수정한다.
 ex) init 파일 변경 등등

Kernel image 압축

1. 수정이 끝났으면 다시 이미지 파일로 압축하여 준다.
#> pwd
/temp/tmp
#> find . | cpio -o -c |gzip -9 > /temp/initrd-2.6.29.6.img

2. 다시 생성된 이미지 파일을 /boot 디렉토리로 복사한다.
#> cp /temp/initrd-2.6.29.6.img /boot/initrd-2.6.29.6.img

Posted by Kimos
2009. 6. 4. 09:48
crontab 은 윈도우의 스케줄러와 같은 역할을 하는 명령어입니다.



CRONtab



crontab -l

-> 현재 crontab에 등록된 작업보기



crontab -e

-> crontab 편집하기





------------------------------------------------------------------------------------



CRONtab
/etc/cron, /usr/spool/cron/crontabs/*

“/etc/cron" 프로그램 은 주기적으로 어떤 프로그램을 수행시키는데 사용된다.

이때 주기적으로 수행되어질 프로그램은 "/usr/spool/cron/crontabs" 디렉토리

밑에 각 사용자의 사용자명과 같은 이름으로 생성된다.

이 화일은 만드는 방법은 아래 명령을 사용하면 된다.

% crontab -l root : /var/spool/cron/crontabs/root 내용 display

% crontab -e root :

이 명령을 root가 수행했으면 /var/spool/cron/crontabs/ DIR 하위에

"root" 라는 이름의 화일이 생성된다)

또는 vi 로 편집

--------------------------------------------------------------------------------

예)

# more /var/spool/cron/crontabs/root

# minute hour day month week

# 0~59 0~23 1~31 1~12 0~6 (0=sunday, 1=monday)

#

15,45 3 * * * find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune

5 9 * * 6 /usr/lib/newsyslog >/dev/null 2>&1

15 0,8 16 * * find /var/preserve/ -mtime +7 -a -exec rm -f {} \;

--------------------------------------------------------------------------------

crontab 화일의 맨 앞의 5번째 칼럼까지에는 각 명령이 수행되어질 일시와 요일이다.

지정한 것들은 아래와 같은 의미를 갖는다.

분 시간 날짜 달 요일 : 구분은 Space

15,45 3 * * * : 매일 3시 15분관 45분에 수행

5 9 * * 6 : 매주 금요일 9시 5분에 수행

15 1,18 16 * * : 매달 16일 1시15분과 오후 6시 15분에 수행



1) /var/spool/cron/crontabs/root (root계정으로 가정할때..)

위 파일을 편집하여 원하는 스케쥴을 설정/편집 한다.

2) ps -ef|grep cron : 현재 cron deamon이 돌고 있는지 확인

3) kill -9 "pid of cron" : cron deamon kill

4) rm /usr/lib/cron/FIFO : lock파일제거(/usr/lib/cron directory는 /etc/cron.d와 링크되어있음)

5) /usr/sbin/cron : deamon 재실행(위 편집한 명령대로 수행함)



예) vi /var/spool/cron/crontabs/root

###############################

#Min Hour Day Month Day Command

###############################

15 4 * * * find /var/preserve/ -mtime +7 -a -exec rm -f {} \;

0 23 * * * sh `sed -n 1p /etc/Alis`/janitor

0 * * * * /usr/lib/acct/ckpacct

10 12 * * 1-6 /usr/lib/acct/dodisk

20 12 1 * * /usr/lib/acct/monacct

30 12 * * 1-6 /usr/lib/acct/runacct 2> /var/adm/acct/nite/fd2log



※ log는 /var/cron/..... 에 생성됨





------------------------------------------------------------------------------------



1. 개요 (cron이 뭐하는 것인지 전혀 모르는 분들만)

cron(크론)은 원하는 시간에 명령(프로그램)을 시키기 위한 데몬이다.
서버는 늘 깨어있다는 것을 이용한 최대한의 활용법이 될 수 있다.

- 내가 새벽 3시에 서버에 특정 작업을 해줘야하는데 그 때 깨어있을 수 있는가?
- 또는 30분간격으로 HDD의 사용량을 운영자에게 알리도록 해야한다면?
- 매월 초에 자료를 백업 받고 싶다면?

바로 이럴 때 cron은 최고의 해결책을 제시한다.
cron은 항상 지정한 시간이 되었는지 확인을 하여 해당 명령어을 실행하는 것이다.

2. cron 설정

1) crontab 파일 위치 및 조회

작업 설정 파일을 crontab 파일이라고 부르며, 이 파일의 위치는 OS별로 차이가 있다.
리눅스는 /var/spool/cron/ID, 솔라리스는 /var/spool/corn/crontabs/ID 에 위치한다.
그럼 이 파일을 직접 수정해야 하는가? 그렇지 않다. crontab 명령을 통해 설정과 조회를 한다.

설정 내용을 조회해 보자. (-l 옵션)


$ crontab -l
no crontab for truefeel



설정한 적이 없어 아직 비어있다.

2) crontab 파일 형식


------ -------- ---------------------------------------------------
필 드 의 미 범 위
------ -------- ---------------------------------------------------
첫번째 분 0-59
두번째 시 0-23
세번째 일 0-31
네번째 월 1-12
다섯번째 요일 0-7 (0 또는 7=일요일, 1=월, 2=화,...)
여섯번째 명령어 실행할 명령을 한줄로 쓴다.
------ -------- ---------------------------------------------------


- 한 줄당 하나의 명령 (두줄로 나눠서 표시할 수 없음)
- # 으로 시작하는 줄은 실행하지 않는다.

설정을 해보자. (-e 옵션)
crontab -e 을 하면 vi 에디터가 나온다.(환경변수 EDITOR에 따라 다른 에디터를 사용할 수 있다.)

$ crontab -e
# /home 디렉토리를 /BACKUP/home 으로 백업해둠
#
# 30분, 새벽 4시와 낮 12시, 모든 일, 모든 월, 모든 요일
30 4,12 * * * /usr/bin/rsync -avxH --delete /home /BACKUP/home > /dev/null 2>&1
#
# 파일/디렉토리 퍼미션 설정
# 40분, 새벽 1시, 매주 일요일
40 1 * * 0 /root/bin/perm_set.sh > /dev/null 2>&1




위는 매일 4:30분과 12:30분에 rsync 명령을, 매주 일요일 1:40분에 perm_set.sh를 실행함을 의미한다.

vi 에디터를 통해 설정을 하므로 중요한 몇 가지 에디터 사용법은 익혀야 한다.

---- -----------------------------------------------------------------------------
키 의미
---- -----------------------------------------------------------------------------
i 현재 칸에 글을 넣는다.
o 다음줄에 글을 넣는다.
dd 한줄을 삭제한다.
:wq 저장하고 빠져나온다.
ESC 설정중에 명령어 모드(위의 i, o, dd 등을 사용할 수 있는 상태)로 빠져 나온다.
---- -----------------------------------------------------------------------------


3) 설정 예

시간 설정에서 몇가지 의미있는 것들을 알아보자.

- '*'표시는 해당 필드의 모든 시간을 의미한다.
- 3,5,7 와 같이 콤마(,)로 구분하여 여러 시간대를 지정할 수 있다.
- 2-10와 같이 하이픈(-)으로 시간 범위도 지정할 수 있다.
- 2-10/3와 같이 하이픈(-)으로 시간 범위를 슬래쉬(/)로 시간 간격을 지정할 수 있다.
(2~10까지 3간격으로. 즉, 3,6,9를 의미함)


원하는 시간 형 식

매주 토요일 새벽 2:20 20 2 * * 6 명령어

매일 오후 4,5,6시 0 4-6 * * * 명령어

매일 2시간간격으로 5분대에 5 */2 * * * 명령어

매월 1일 새벽 1:15 15 1 1 * * 명령어

1,7월 1일 새벽 0:30 30 0 1 1,7 * 명령어




3. FAQ

1) cron 설정한 후에는 crond 데몬을 재실행해야 하나요?

아닙니다. crontab -e 으로 설정 후 빠져나오면 바로 적용됩니다.

2) truefeel 사용자는 cron을 못 쓰게 하고 싶습니다.

/etc/cron.allow : 허용할 사용자 ID 목록
/etc/cron.deny : 거부할 사용자 ID 목록

cron.allow 파일이 있으면 이 파일에 들어있는 ID만 사용 가능
cron.deny 파일이 있으면 이 파일에 들어있는 ID는 사용 불가

따라서 cron.deny에 truefeel ID를 추가해주면 됩니다.

3) > /dev/null 2>&1 이 무슨 뜻입니까?

지정한 명령어 처리 결과와 발생할지 모르는 에러메시지를 출력하지 않고 모두 버린다는(/dev/null)는
뜻입니다. 만약 결과와 에러를 파일로 저장하려면 /dev/null 대신 파일명을 적어주면 됩니다.
Posted by Kimos
2009. 5. 28. 12:13

# 현재 하드 용량이 얼마나 쓰고 있는지 체크 후, 관리자에게 메일을 전송해주는 Script

#!/usr/bin/perl

$EMAIL1="naver\@naver\.com";
$EMAIL2="nate\@nate\.com";
$EMAIL3="gmail\@gamil\.com";

$DF=`which df`;
chop($DF);
$SED=`which sed`;
chop($SED);
$MAIL=`which mail`;
chop($MAIL);

# Check HDD
$FILE = "/tmp/fh_check_hdd.txt";
$CMD="$DF |$SED -e '/^[^ ][^ ]*\$/{ N ; s/[ ]*\\n[ ]*/ /;}' |awk '{print \$5}' >$FILE";
system($CMD);
$DFALL = "$DF > /tmp/fh_hdd.txt";
$SEND = "$MAIL -s \"[IRLink-DCS서버용량확인]서버용량을 Check해주세요\" -c
$EMAIL2 -b $EMAIL3 $EMAIL1 < /tmp/fh_hdd.txt";

open RD, "<$FILE";
while( $Line = <RD> ){
    chop( $Line );
    &Trim( $Line );
    if( $Line eq "" ){
        next;
    }
    my($use,@d)=split("%",$Line);
    if( $Line=~/\d+/ ){
        if( $use > 80 ){
            print "checking hdd --> 사용량 : $use\n";
            system($DFALL);
            system($SEND);
        }
    }
}
close(RD);

sub Trim($) {
    my $string = shift;
    $string =~ s/^\s+//;
    $stirng =~ s/\s+$//;
    return $string;
}

Posted by Kimos