Skip to content

Commit

Permalink
Merge pull request #30 from hertg/0.13.0
Browse files Browse the repository at this point in the history
0.13.0
  • Loading branch information
hertg committed Feb 27, 2020
2 parents b82eceb + 79b9211 commit 07280e5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ $ sudo egpu-switcher setup
```

Uninstall:
> **Warning**: Do not use this command on any version prior to 0.10.2!
> **Critical Warning**: **Do not use this command on any version prior to `0.10.2`!**\
> There was a critical typo in the Makefile which would delete your `/usr/bin` folder. Please do a manual uninstall by removing the `egpu-switcher` folder in the `/usr/bin/` and the `/usr/share/` directory.
```bash
$ sudo egpu-switcher cleanup
$ make uninstall
```

> **Hint**: Up until version `0.12.0` there was an [issue](https://github.com/hertg/egpu-switcher/issues/25) that the cleanup command needed the egpu-switcher to be set up for the cleanup to work. If you are having trouble to cleanup, remove or upgrade the egpu-switcher take a look at [this possible fix](https://github.com/hertg/egpu-switcher/issues/25#issuecomment-590728815).
## Commands
<pre>
<b>egpu-switcher setup</b> [--override] [--noprompt]
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
egpu-switcher (0.13.0) disco; urgency=medium

* Prevent error on cleanup if setup hasnt been executed
* Remove unnecessary console print

-- Michael Hertig <[email protected]> Thu, 27 Feb 2020 23:33:13 +0100

egpu-switcher (0.12.0) disco; urgency=medium

* Better GPU detection with "lspci -d" (thanks to xabolcs)
Expand Down
2 changes: 1 addition & 1 deletion debian/files
Original file line number Diff line number Diff line change
@@ -1 +1 @@
egpu-switcher_0.12.0_source.buildinfo utils optional
egpu-switcher_0.13.0_source.buildinfo utils optional
31 changes: 17 additions & 14 deletions egpu-switcher
Original file line number Diff line number Diff line change
Expand Up @@ -412,28 +412,31 @@ function cleanup() {
rm -f ${xfile_internal}

# delete the xorg.conf file, if it is a symlink and restore the last backup
if [ -L ${xfile} ]; then
rm -f ${xfile}
if [ -e ${xfile_backup}.* ]; then
local lastbackup=$(ls -t ${xfile_backup}.* | head -1)
print_info "Restoring latest backup ${green}${lastbackup}"
mv ${lastbackup} ${xfile}
else
print_info "Backup not found, restoring system without xorg.conf"
fi
if [ -L ${xfile} ]; then
rm -f ${xfile}
if [ -e ${xfile_backup}.* ]; then
local lastbackup=$(ls -t ${xfile_backup}.* | head -1)
print_info "Restoring latest backup ${green}${lastbackup}"
mv ${lastbackup} ${xfile}
fi
fi

if [ ${hard} -eq 1 ]; then
print_info "Removing configuration files (--hard)"
rm -f ${config_file}
rm -fd ${config_dir}
fi

systemctl stop egpu.service
systemctl disable egpu.service
rm ${systemd_folder}/egpu.service
systemctl daemon-reload
systemctl reset-failed
# only try to stop the egpu.service if its loaded.
# note: using sed rather than the --value property on purpose, to support older versions of systemd
if [ $(sudo systemctl show -p LoadState egpu.service | sed 's/LoadState=//g') == "loaded" ]; then
print_info "Removing the 'egpu.service' systemd service"
systemctl stop egpu.service
systemctl disable egpu.service
rm ${systemd_folder}/egpu.service
systemctl daemon-reload
systemctl reset-failed
fi

print_success "Done... Finished cleanup"
}
Expand Down
Binary file modified images/screenshot_setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 07280e5

Please sign in to comment.