- 论坛徽章:
- 0
|
- #!/bin/bash
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
- export PATH
- for i in $(chkconfig --list | sort | awk '{print $1}')
- do
- echo -n "How to deal with the $i service: [Disable|Enable|d|e]"
- read p
- bb=0
- while [ "$bb"="0" ]
- do
-
- case $p in
- d|Disable)
- service $i stop
- chkconfig $i off
- bb=1
- echo $(service $i status)
- break
- ;;
- e|Enable)
- if [ "$(service $i status | awk '{print $NF}')"="running..." ] ; then
- echo $(service $i status)
- bb=1
- break
- else
- chkconfig --level 3 $i on
- service $i start
- bb=1
- break
- fi
- ;;
- *)
- echo -n "Please input again [d|e]: "
- read p
- ;;
- esac
- done
- done
复制代码 我重新写了一段。可是测试当我输入 e,并不执行service $i start 和chkconfig --level 3 $i on ,这是怎么会事呢?
当然是在vmware workstations下完成的. |
|