Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Dec 27, 2020
1 parent 8bfd845 commit 0e3dffe
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 14 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,13 @@ The encryption and key computation are done using the `golang.org/x/crypto/nacl/

After the site information is added, the site's generated private key is thrown away.

## Uninstall [secman][smUrl]

if you want yo uninstall `secman`, you should type

```sh
❯ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/abdfnx/secman/HEAD/uninstall.sh)"
```

[goUrl]: https://goland.org
[smUrl]: https://secman.web.app
74 changes: 60 additions & 14 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,61 @@ goodBye() {
smLoc=/usr/local/bin/secman
SECDIR=~/.secman

clearAllData() {
echo -e "clear all data?\n[Y/n]"
read -n 1 accept

if [[ $accept == "" || $accept == "Y" || $accept == "y" ]]; then
if [ -x "$(command -v sudo)" ]; then
if [ -x "$(command -v manx)" ]; then
sudo manx $SECDIR

else
installManx

sudo manx $SECDIR
fi
else
if [ -x "$(command -v manx)" ]; then
manx $SECDIR

else
installManx

manx $SECDIR
fi
fi
fi

echo "after clear, you can find your old .secman in ~/.local/share/Trash if you want to restore it"
}

installManx() {
if [ -x "$(command -v sudo)" ]; then
sudo npm i -g @abdfnx/manx
else
npm i -g @abdfnx/manx
fi
}

manxopa() {
if [ -x "$(command -v sudo)" ]; then
sudo manx $smLoc $SECDIR
sudo manx $smLoc
else
manx $smLoc $SECDIR
manx $smLoc
fi

clearAllData
}

rmOpa() {
if [ -x "$(command -v sudo)" ]; then
sudo rm -rf $smLoc $SECDIR
sudo rm -rf $smLoc
else
rm -rf $smLoc $SECDIR
rm -rf $smLoc
fi

clearAllData
}

if [ -x "$(command -v secman)" ]; then
Expand All @@ -31,18 +72,23 @@ if [ -x "$(command -v secman)" ]; then
if [ -x "$(command -v manx)" ]; then
manxopa
else
if [ -x "$(command -v sudo)" ]; then
sudo npm i -g @abdfnx/manx
# if [ -x "$(command -v sudo)" ]; then
# sudo npm i -g @abdfnx/manx

if [ -x "$(command -v manx)" ]; then
manxopa
fi
else
npm i -g @abdfnx/manx
# if [ -x "$(command -v manx)" ]; then
# manxopa
# fi
# else
# npm i -g @abdfnx/manx

# if [ -x "$(command -v manx)" ]; then
# manxopa
# fi
# fi

if [ -x "$(command -v manx)" ]; then
manxopa
fi
installManx
if [ -x "$(command -v manx)" ]; then
manxopa
fi
fi
elif [ "$un" == "rm" ]; then
Expand Down

0 comments on commit 0e3dffe

Please sign in to comment.