This repository has been archived by the owner on Jan 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23bb887
commit c5264cd
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Colorful output. | ||
function greenprint { | ||
echo -e "\033[1;32m[$(date -Isecond)] ${1}\033[0m" | ||
} | ||
function redprint { | ||
echo -e "\033[1;31m[$(date -Isecond)] ${1}\033[0m" | ||
} | ||
|
||
if ! hash subscription-manager; then | ||
exit 0 | ||
fi | ||
if ! sudo subscription-manager status; then | ||
exit 0 | ||
fi | ||
if sudo subscription-manager unregister; then | ||
greenprint "Host unregistered." | ||
exit 0 | ||
fi | ||
redprint "Failed to unregister" | ||
exit 1 |