deleted: install_shell/cgroup-d5000-install/42-2014-01-15-062120/README deleted: install_shell/cgroup-d5000-install/42-2014-01-15-062120/install.sh modified: install_shell/cgroup-d5000-install/install.sh modified: install_shell/create_users.sh modified: install_shell/ntpd_cron_patch.sh modified: install_shell/other.sh modified: install_shell/set_network.sh modified: install_shell/set_ssh.sh modified: setup.sh Signed-off-by: Qin Bo <bqin@linx-info.com>
44 lines
1.2 KiB
Bash
Executable File
44 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -f /var/spool/cron/crontabs/root ];then
|
|
grep update_time.sh /var/spool/cron/crontabs/root &> /dev/null
|
|
if [ $? = 0 ];then
|
|
sed -i '/update_time.sh/d' /var/spool/cron/crontabs/root
|
|
echo "*/1 * * * * sysadmin /usr/sbin/update_time.sh" >> /etc/crontab
|
|
fi
|
|
else
|
|
grep update_time.sh /etc/crontab | grep sysadmin &> /dev/null
|
|
if [ $? != 0 ];then
|
|
echo "*/1 * * * * sysadmin /usr/sbin/update_time.sh" >> /etc/crontab
|
|
fi
|
|
fi
|
|
|
|
|
|
#d5000 cron example
|
|
cp d5000_cron_example.sh /opt/
|
|
|
|
#ntp client
|
|
if [ -f /usr/sbin/update_time.sh ];then
|
|
chmod +x /usr/sbin/update_time.sh
|
|
chown sysadmin:sysadmin /usr/sbin/update_time.sh
|
|
else
|
|
|
|
cat > /usr/sbin/update_time.sh << 'EOF'
|
|
#!/bin/bash
|
|
NTPSERVER_A=''
|
|
NTPSERVER_B=''
|
|
NTPDATE='/usr/sbin/ntpdate'
|
|
${NTPDATE} ${NTPSERVER_A} || ${NTPDATE} ${NTPSERVER_B}
|
|
hwclock -w
|
|
EOF
|
|
|
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
|
chmod +x /usr/sbin/update_time.sh
|
|
chown sysadmin:sysadmin /usr/sbin/update_time.sh
|
|
fi
|
|
|
|
#ntp server
|
|
sed -i '/ntps1*/d' /etc/ntp/ntp.conf
|
|
sed -i '/ntp1*/d' /etc/ntp/ntp.conf
|
|
|