Skip to content

Commit

Permalink
Merge pull request #75 from Superbition/develop
Browse files Browse the repository at this point in the history
New Release Merge: v5.0.3
  • Loading branch information
danielashare authored May 30, 2021
2 parents d4f8c49 + 09d5feb commit efb2cec
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
cmake-build*
AUTH_TOKEN
lib/*
.wakatime-project
.wakatime-project
include/*
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [v5.0.3 (2021-05-30)](https://github.com/Superbition/Bakup-Agent/releases/tag/v5.0.3)

### Added
- Added upgrade path that doesn't remove agent from [Bakup.io](https://bakup.io) (#74)

## [v5.0.2 (2021-05-29)](https://github.com/Superbition/Bakup-Agent/releases/tag/v5.0.2)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Agent
const string apiVersion = "1";

// Version of the agent
const string agentVersion = "v5.0.2";
const string agentVersion = "v5.0.3";

// Program loop wait time in seconds
const int pollTime = 60;
Expand Down
16 changes: 15 additions & 1 deletion uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ if [ "$EUID" -ne 0 ]
exit 1
fi

LOCAL_UNINSTALL=false

# If this is a local uninstall (like when doing an upgrade), don't report the uninstall to Bakup
if [ $# -gt 0 ]
then
if [ $1 == "--local-uninstall" ]
then
LOCAL_UNINSTALL=true
fi
fi

# Stop existing service
echo "Stopping Bakup Agent..."
service bakupagent stop
Expand All @@ -15,7 +26,10 @@ systemctl disable bakupagent
echo "Removing agent from Bakup..."
CLIENT_ID=$(cat /etc/opt/bakupagent/CLIENT_ID)
API_TOKEN=$(cat /etc/opt/bakupagent/API_TOKEN)
wget -q "https://bakup.io/api/agent/v1/uninstall?client_id=$CLIENT_ID&api_token=$API_TOKEN" &> /dev/null
if ! $LOCAL_UNINSTALL
then
wget -q "https://bakup.io/api/agent/v1/uninstall?client_id=$CLIENT_ID&api_token=$API_TOKEN" &> /dev/null
fi

# Delete directories
echo "Deleting directories and data..."
Expand Down
2 changes: 1 addition & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if ! USER_ID=$(cat /etc/opt/bakupagent/USER_ID)
fi

echo "Uninstalling current agent..."
/opt/bakupagent/uninstall.sh
/opt/bakupagent/uninstall.sh --local-uninstall

# This cd takes the script out of the deleted directory before running the install script. This stops getcwd() errors
# saying it can't find the directory
Expand Down

0 comments on commit efb2cec

Please sign in to comment.