feat: Add complete iSCSI target management to Web UI- Add iSCSI tab with full target management- Implement create/delete targets with auto-generated IQN- Add LUN (backing store) management- Implement initiator ACL management (bind/unbind)- Add real-time target listing with LUN/ACL counts- Add comprehensive iSCSI management guide- Update sudoers to allow tgtadm commands- Add tape management features (create/list/delete/bulk delete)- Add service status monitoring- Security: Input validation, path security, sudo restrictions- Tested: Full CRUD operations working- Package size: 29KB, production ready
This commit is contained in:
88
uninstall.sh
Normal file
88
uninstall.sh
Normal file
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
INSTALL_DIR="/opt/adastra-vtl"
|
||||
WEB_DIR="/var/www/html/mhvtl-config"
|
||||
SYSTEMD_DIR="/etc/systemd/system"
|
||||
CONFIG_DIR="/etc/mhvtl"
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
print_info() {
|
||||
echo -e "${YELLOW}➜${NC} $1"
|
||||
}
|
||||
|
||||
print_success() {
|
||||
echo -e "${GREEN}✓${NC} $1"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}✗${NC} $1"
|
||||
}
|
||||
|
||||
check_root() {
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
print_error "Please run as root or with sudo"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
uninstall_adastra() {
|
||||
print_info "Stopping services..."
|
||||
systemctl stop mhvtl 2>/dev/null || true
|
||||
systemctl disable mhvtl 2>/dev/null || true
|
||||
|
||||
print_info "Unloading kernel modules..."
|
||||
if [ -f /usr/local/bin/mhvtl-unload ]; then
|
||||
/usr/local/bin/mhvtl-unload 2>/dev/null || true
|
||||
fi
|
||||
|
||||
print_info "Removing files..."
|
||||
rm -rf "$INSTALL_DIR"
|
||||
rm -rf "$WEB_DIR"
|
||||
rm -f "$SYSTEMD_DIR"/mhvtl*.service
|
||||
rm -f /usr/local/bin/mhvtl-load
|
||||
rm -f /usr/local/bin/mhvtl-unload
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
print_info "Removing mhvtl..."
|
||||
rm -f /usr/bin/vtl*
|
||||
rm -f /usr/bin/mktape
|
||||
rm -f /lib/modules/$(uname -r)/kernel/drivers/scsi/mhvtl.ko 2>/dev/null || true
|
||||
depmod -a
|
||||
|
||||
print_success "Adastra VTL uninstalled"
|
||||
|
||||
echo ""
|
||||
print_info "Note: Configuration files in $CONFIG_DIR were preserved"
|
||||
print_info "Note: User 'vtl' and group 'vtl' were preserved"
|
||||
print_info "To remove them manually:"
|
||||
echo " userdel vtl"
|
||||
echo " groupdel vtl"
|
||||
echo " rm -rf $CONFIG_DIR"
|
||||
echo " rm -rf /var/lib/mhvtl"
|
||||
}
|
||||
|
||||
main() {
|
||||
echo "Adastra VTL Uninstaller"
|
||||
echo ""
|
||||
|
||||
check_root
|
||||
|
||||
read -p "Are you sure you want to uninstall Adastra VTL? (y/N): " -n 1 -r
|
||||
echo
|
||||
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
uninstall_adastra
|
||||
else
|
||||
print_info "Uninstall cancelled"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user