Update setup
This commit is contained in:
@@ -14,6 +14,22 @@ print_info() {
|
|||||||
printf "${CYAN}➜ %s${NC}\n" "$1"
|
printf "${CYAN}➜ %s${NC}\n" "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ask_optional_step() {
|
||||||
|
local step_name="$1"
|
||||||
|
local callback="$2"
|
||||||
|
|
||||||
|
printf "\n${YELLOW}❓ Do you want to install and setup %s? [Y/n] ${NC}" "$step_name"
|
||||||
|
read choice
|
||||||
|
case "$choice" in
|
||||||
|
n|N|no|No|NO )
|
||||||
|
print_info "Skipping $step_name setup."
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
$callback
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
setup_server() {
|
setup_server() {
|
||||||
print_step "Setting up Server"
|
print_step "Setting up Server"
|
||||||
print_info "Updating packages and configuring firewall..."
|
print_info "Updating packages and configuring firewall..."
|
||||||
@@ -71,13 +87,6 @@ setup_zsh() {
|
|||||||
|
|
||||||
setup_tailscale() {
|
setup_tailscale() {
|
||||||
print_step "Setting up Tailscale"
|
print_step "Setting up Tailscale"
|
||||||
printf "\n${YELLOW}❓ Do you want to install and setup Tailscale? [Y/n] ${NC}"
|
|
||||||
read choice
|
|
||||||
case "$choice" in
|
|
||||||
n|N|no|No|NO )
|
|
||||||
print_info "Skipping Tailscale setup."
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
if ! command -v tailscale > /dev/null 2>&1; then
|
if ! command -v tailscale > /dev/null 2>&1; then
|
||||||
print_info "Installing Tailscale..."
|
print_info "Installing Tailscale..."
|
||||||
curl -fsSL https://tailscale.com/install.sh | sh
|
curl -fsSL https://tailscale.com/install.sh | sh
|
||||||
@@ -85,15 +94,26 @@ setup_tailscale() {
|
|||||||
else
|
else
|
||||||
print_info "Tailscale is already installed."
|
print_info "Tailscale is already installed."
|
||||||
fi
|
fi
|
||||||
;;
|
}
|
||||||
esac
|
|
||||||
|
setup_wifitui() {
|
||||||
|
print_step "Setting up Wifitui"
|
||||||
|
print_info "Downloading Wifitui..."
|
||||||
|
TAG=$(curl -s https://api.github.com/repos/shazow/wifitui/releases/latest | grep "tag_name" | cut -d '"' -f4)
|
||||||
|
OS="linux-$(uname -m)" # x86_64 or arm64
|
||||||
|
LATEST_RELEASE="https://github.com/shazow/wifitui/releases/download/${TAG}/wifitui-${TAG:1}-${OS}"
|
||||||
|
curl -Lfs "${LATEST_RELEASE}.deb" -o /tmp/wifitui.deb
|
||||||
|
sudo apt install /tmp/wifitui.deb
|
||||||
|
rm -f /tmp/wifitui.deb
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
setup_server
|
setup_server
|
||||||
setup_docker
|
setup_docker
|
||||||
setup_zsh
|
setup_zsh
|
||||||
setup_tailscale
|
|
||||||
|
ask_optional_step "Tailscale" setup_tailscale
|
||||||
|
ask_optional_step "Wifitui" setup_wifitui
|
||||||
|
|
||||||
printf "\n${GREEN}✔ Setup complete! Please log out and log back in for all changes to take effect.${NC}\n"
|
printf "\n${GREEN}✔ Setup complete! Please log out and log back in for all changes to take effect.${NC}\n"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user