Skip to content

Commit

Permalink
Fixed using shopt -s extglob
Browse files Browse the repository at this point in the history
  • Loading branch information
ldrahnik committed Mar 7, 2023
1 parent cc4d670 commit c0f4db8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sudo bash ./install.sh
## Uninstallation

```bash
sudo ./uninstall.sh
sudo bash ./uninstall.sh
```

## Customization
Expand Down
6 changes: 4 additions & 2 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ then
exit 1
fi

# for `rm` exclude !(xy)
shopt -s extglob

systemctl stop power_supply_mode_switcher
if [[ $? != 0 ]]
then
Expand Down Expand Up @@ -52,8 +55,7 @@ then
fi
;;
*)
shopt -s extglob
rm -rf /usr/share/power_supply_mode_switcher-driver/!(conf)
rm -rf "/usr/share/power_supply_mode_switcher-driver/"!(conf)
if [[ $? != 0 ]]
then
echo "/usr/share/power_supply_mode_switcher-driver/ cannot be removed correctly..."
Expand Down

0 comments on commit c0f4db8

Please sign in to comment.