mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
* bin/ec2-cost: handle on/off configuration like *all* other status
scripts, no need for FORCE Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
72f695d1af
commit
8b67bda974
1 changed files with 0 additions and 14 deletions
14
bin/ec2-cost
14
bin/ec2-cost
|
@ -17,31 +17,17 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
FORCE=0
|
|
||||||
DETAIL=0
|
DETAIL=0
|
||||||
PKG="byobu"
|
PKG="byobu"
|
||||||
|
|
||||||
# Default is "off"
|
|
||||||
p="ec2-cost"
|
|
||||||
grep -qs "^$p=1$" "$HOME/.$PKG/status" && FORCE=1
|
|
||||||
grep -qs "^$p=0$" "$HOME/.$PKG/status" && FORCE=0
|
|
||||||
|
|
||||||
for arg in $@; do
|
for arg in $@; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-f|--force)
|
|
||||||
FORCE=1
|
|
||||||
;;
|
|
||||||
-d|--detail)
|
-d|--detail)
|
||||||
DETAIL=1
|
DETAIL=1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Exit immediately if this is not an Amazon EC2 instance, we're not
|
|
||||||
# manually turned on, and we're not in force mode
|
|
||||||
[ -r "/etc/ec2_version" -o -r "$HOME/.$PKG/ec2-cost" -o "$FORCE" = "1" ]
|
|
||||||
[ "$?" = "0" ] || exit 0
|
|
||||||
|
|
||||||
# Approximate Instance Cost Basis
|
# Approximate Instance Cost Basis
|
||||||
# US Europe
|
# US Europe
|
||||||
# Small (1cpu, 32bit) $0.10/h $0.11/h
|
# Small (1cpu, 32bit) $0.10/h $0.11/h
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue