- 论坛徽章:
- 78
|
本帖最后由 yybmsrs 于 2016-01-22 16:42 编辑
- $ service ntpd status
- Redirecting to /bin/systemctl status ntpd.service
- ntpd.service - Network Time Service
- Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
- Active: active (running) since Wed 2015-12-02 11:22:13 CST; 1 months 20 days ago
- Process: 13023 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
- Main PID: 13024 (ntpd)
- CGroup: /system.slice/ntpd.service
- └─13024 /usr/sbin/ntpd -u ntp:ntp -g
复制代码- status=$(service ntpd status)
- if [[ "$status" =~ "Redirecting to\.*" ]]; then
- echo 111
- fi
复制代码 请教怎么写。。。 |
|