Remove duplicate functions
This commit is contained in:
parent
11dd0f6262
commit
437a4b14af
3 changed files with 2400 additions and 100 deletions
100
install.sh
100
install.sh
|
@ -178,42 +178,6 @@ detect_network() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Choose VPN provider
|
||||
choose_vpn_provider() {
|
||||
echo ""
|
||||
echo -e "${CYAN}VPN Provider Selection${NC}"
|
||||
echo ""
|
||||
echo -e " ${BOLD}1)${NC} Mullvad VPN (Commercial Provider)"
|
||||
echo -e " ${BOLD}2)${NC} Custom WireGuard (Own Server/VPS)"
|
||||
echo -e " ${BOLD}3)${NC} Import existing WireGuard config"
|
||||
echo ""
|
||||
|
||||
while true; do
|
||||
read -p "Select provider [1-3]: " VPN_PROVIDER_CHOICE
|
||||
case $VPN_PROVIDER_CHOICE in
|
||||
1)
|
||||
VPN_PROVIDER="mullvad"
|
||||
get_mullvad_account
|
||||
break
|
||||
;;
|
||||
2)
|
||||
VPN_PROVIDER="custom"
|
||||
get_custom_wireguard_details
|
||||
break
|
||||
;;
|
||||
3)
|
||||
VPN_PROVIDER="import"
|
||||
import_wireguard_config
|
||||
break
|
||||
;;
|
||||
*)
|
||||
error "Invalid choice. Please select 1, 2, or 3."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
log "VPN provider selected: $VPN_PROVIDER"
|
||||
}
|
||||
|
||||
# Get Mullvad account
|
||||
get_mullvad_account() {
|
||||
|
@ -584,23 +548,6 @@ EOF
|
|||
log "Killswitch installed and activated"
|
||||
}
|
||||
|
||||
# Install VPN provider specific components
|
||||
install_vpn_provider() {
|
||||
log "Installing VPN provider components..."
|
||||
|
||||
case "$VPN_PROVIDER" in
|
||||
mullvad)
|
||||
install_mullvad
|
||||
;;
|
||||
custom)
|
||||
setup_custom_provider
|
||||
;;
|
||||
import)
|
||||
setup_import_provider
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Install Mullvad
|
||||
install_mullvad() {
|
||||
log "Installing Mullvad client..."
|
||||
|
@ -771,53 +718,6 @@ EOFAPP
|
|||
log "Backend installed"
|
||||
}
|
||||
|
||||
# Setup nginx (placeholder function)
|
||||
setup_nginx() {
|
||||
log "Setting up nginx reverse proxy..."
|
||||
# This would contain nginx configuration
|
||||
# For now, we'll skip this as it's optional
|
||||
log "Nginx setup skipped (optional)"
|
||||
}
|
||||
|
||||
# Finalize installation
|
||||
finalize_installation() {
|
||||
log "Finalizing installation..."
|
||||
|
||||
# Set proper permissions
|
||||
chown -R root:root "$INSTALL_DIR"
|
||||
chmod +x "$INSTALL_DIR"/scripts/*.sh 2>/dev/null || true
|
||||
|
||||
# Enable and start services
|
||||
systemctl enable vpn-webui vpn-killswitch vpn-security-monitor
|
||||
systemctl start vpn-killswitch
|
||||
systemctl start vpn-security-monitor
|
||||
systemctl start vpn-webui
|
||||
|
||||
log "Installation finalized"
|
||||
}
|
||||
|
||||
# Show installation summary
|
||||
show_summary() {
|
||||
echo ""
|
||||
echo -e "${GREEN}${BOLD}Installation Complete!${NC}"
|
||||
echo ""
|
||||
echo -e "${CYAN}Services Status:${NC}"
|
||||
systemctl is-active vpn-webui && echo -e " WebUI: ${GREEN}Running${NC}" || echo -e " WebUI: ${RED}Stopped${NC}"
|
||||
systemctl is-active vpn-killswitch && echo -e " Killswitch: ${GREEN}Active${NC}" || echo -e " Killswitch: ${RED}Inactive${NC}"
|
||||
systemctl is-active vpn-security-monitor && echo -e " Security Monitor: ${GREEN}Running${NC}" || echo -e " Security Monitor: ${RED}Stopped${NC}"
|
||||
echo ""
|
||||
echo -e "${CYAN}Access Information:${NC}"
|
||||
echo -e " WebUI URL: ${BOLD}http://$LAN_IP:5000${NC}"
|
||||
echo -e " Install Dir: ${BOLD}$INSTALL_DIR${NC}"
|
||||
echo -e " Log File: ${BOLD}$LOG_FILE${NC}"
|
||||
echo ""
|
||||
echo -e "${YELLOW}Important Notes:${NC}"
|
||||
echo -e " • The killswitch is ${BOLD}PERMANENTLY ACTIVE${NC}"
|
||||
echo -e " • No internet access without VPN connection"
|
||||
echo -e " • Use the WebUI to connect to VPN servers"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Install WebUI
|
||||
install_webui() {
|
||||
log "Installing WebUI..."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue