Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ install-utils:
uninstall:
rm -f $(DESTDIR)$(BINDIR)/nvfd
rm -f $(DESTDIR)$(UNITDIR)/nvfd.service
rm -f $(DESTDIR)$(BINDIR)/nvfd-fan-control.sh
rm -f $(DESTDIR)$(UNITDIR)/nvfd-fan-control.service
Comment thread
ricky-chaoju marked this conversation as resolved.
@echo "Config files preserved in $(CONFDIR). Remove manually if desired."

uninstall-utils:
Expand Down
23 changes: 8 additions & 15 deletions scripts/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
set -e

# Parse arguments
WITH_UTILS=false
while [[ $# -gt 0 ]]; do
case "$1" in
--with-utils)
WITH_UTILS=true
shift
;;
--help)
echo "Usage: sudo $(basename "$0") [OPTIONS]"
echo "Usage: sudo $(basename "$0")"
echo
echo "Options:"
echo " --with-utils Also remove utility scripts (nvfd-fan-control.sh and service)"
echo " --help Show this help message"
echo "Uninstalls NVFD and any installed utilities."
echo
exit 0
;;
Expand Down Expand Up @@ -65,22 +58,22 @@ if grep -q 'alias igfc=' /etc/bash.bashrc 2>/dev/null; then
sed -i '/alias igfc=/d' /etc/bash.bashrc
fi

# Remove optional utilities if requested
if [ "$WITH_UTILS" = true ]; then
echo "Removing utility scripts..."
# Auto-detect and remove utilities if installed
if [ -f /usr/local/bin/nvfd-fan-control.sh ] || [ -f /etc/systemd/system/nvfd-fan-control.service ]; then
echo "Detected installed utility scripts, removing..."

# Stop and disable fan-control service if running
if systemctl is-active --quiet nvfd-fan-control.service 2>/dev/null; then
systemctl stop nvfd-fan-control.service
fi
if systemctl is-enabled --quiet nvfd-fan-control.service 2>/dev/null; then
systemctl disable nvfd-fan-control.service
fi

# Remove utility files
rm -f /usr/local/bin/nvfd-fan-control.sh
rm -f /etc/systemd/system/nvfd-fan-control.service

systemctl daemon-reload
fi

Expand Down
Loading