Update Artela.sh
This commit is contained in:
parent
aadf4574b2
commit
cdf7b42a4f
36
Artela.sh
36
Artela.sh
@ -1,5 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 脚本保存路径
|
||||
SCRIPT_PATH="$HOME/Artela.sh"
|
||||
|
||||
# 自动设置快捷键的功能
|
||||
function check_and_set_alias() {
|
||||
local alias_name="art"
|
||||
local shell_rc="$HOME/.bashrc"
|
||||
|
||||
# 对于Zsh用户,使用.zshrc
|
||||
if [ -n "$ZSH_VERSION" ]; then
|
||||
shell_rc="$HOME/.zshrc"
|
||||
elif [ -n "$BASH_VERSION" ]; then
|
||||
shell_rc="$HOME/.bashrc"
|
||||
fi
|
||||
|
||||
# 检查快捷键是否已经设置
|
||||
if ! grep -q "$alias_name" "$shell_rc"; then
|
||||
echo "设置快捷键 '$alias_name' 到 $shell_rc"
|
||||
echo "alias $alias_name='bash $SCRIPT_PATH'" >> "$shell_rc"
|
||||
# 添加提醒用户激活快捷键的信息
|
||||
echo "快捷键 '$alias_name' 已设置。请运行 'source $shell_rc' 来激活快捷键,或重新打开终端。"
|
||||
else
|
||||
# 如果快捷键已经设置,提供一个提示信息
|
||||
echo "快捷键 '$alias_name' 已经设置在 $shell_rc。"
|
||||
echo "如果快捷键不起作用,请尝试运行 'source $shell_rc' 或重新打开终端。"
|
||||
fi
|
||||
}
|
||||
|
||||
# 节点安装功能
|
||||
function install_node() {
|
||||
|
||||
# 检查命令是否存在
|
||||
exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
@ -96,6 +127,5 @@ sudo systemctl start artelad
|
||||
|
||||
# 完成设置
|
||||
echo '====================== 安装完成 ==========================='
|
||||
echo -e "\e[1;32m 检查状态: \e[0m\e[1;36m sudo systemctl status artelad \e[0m"
|
||||
echo -e "\e[1;32m 查看日志: \e[0m\e[1;36m sudo journalctl -fu artelad -o cat \e[0m"
|
||||
echo -e "\e[1;32m 检查同步状态: \e[0m\e[1;36m artelad status | jq .SyncInfo \e[0m"
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user