更新 scripts/system_optimize.sh
This commit is contained in:
parent
623a95ba6e
commit
c8e4db1ad3
|
|
@ -175,10 +175,19 @@ rename_hostname(){
|
||||||
log_info "主机名已修改!"
|
log_info "主机名已修改!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#清理历史命令
|
||||||
|
clear_history(){
|
||||||
|
log_info "开始历史命令..."
|
||||||
|
> ~/.bash_history
|
||||||
|
history -c
|
||||||
|
log_info "历史命令已清理"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 主函数:按顺序执行所有配置步骤
|
# 主函数:按顺序执行所有配置步骤
|
||||||
main() {
|
main() {
|
||||||
log_info "开始系统配置..."
|
log_info "|---------------开始系统配置------------------"
|
||||||
disable_apt_periodic_updates
|
disable_apt_periodic_updates
|
||||||
set_timezone_to_shanghai
|
set_timezone_to_shanghai
|
||||||
lock_current_kernel
|
lock_current_kernel
|
||||||
|
|
@ -188,7 +197,8 @@ main() {
|
||||||
update_grub_configuration
|
update_grub_configuration
|
||||||
off_sleep
|
off_sleep
|
||||||
rename_hostname
|
rename_hostname
|
||||||
log_info "系统配置完成!"
|
clear_history
|
||||||
|
log_info "|----------------系统配置完成!------------------"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 执行主函数
|
# 执行主函数
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue