github.com/qiuhoude/go-web@v0.0.0-20220223060959-ab545e78f20d/prepare/18channeluse/stream/mydate.sh (about) 1 #!/bin/bash 2 3 params=(${@}) 4 5 if [[ ${#params[*]} -gt 0 ]] ;then 6 for i in ${params[@]} ;do 7 if [[ "$i" = "-s" ]] ;then 8 while [[ "${confirm}" != "yes" ]] && [[ "${confirm}" != "no" ]]; do 9 echo -ne "\e[4;41;37m 线上修改时间谨慎操作!!! \e[0m\n 是否继续 (yes or no):" 10 read confirm 11 done 12 [[ "${confirm}" == "yes" ]] && /bin/date $@ 13 exit 14 fi 15 done 16 fi 17 18 19 # 直接执行 20 /bin/date $@ 21