Last active
December 16, 2016 17:41
-
-
Save brianoflan/029e3a89d80066ab1d97a803b0280f89 to your computer and use it in GitHub Desktop.
Fix AWS EC2 instance root umask for awscli and cloud-utils (and euca2ools, hiera-eyaml, gem, umask, chmod)
This file contains hidden or 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
#!/bin/bash | |
main() { | |
forceRoot ; | |
local pkg='' ; | |
for pkg in awscli hiera-eyaml ; do | |
gem uninstall $pkg --executables ; | |
done ; | |
for pkg in awscli ; do | |
yum -y install $pkg ; | |
done; | |
for pkg in cloud-utils euca2ools awscli ; do | |
yum -y remove $pkg ; | |
done ; | |
umask 0022 ; | |
for pkg in cloud-utils euca2ools awscli ; do | |
yum -y install $pkg ; | |
done ; | |
for pkg in awscli hiera-eyaml ; do | |
gem install $pkg ; | |
done ; | |
ls -l /usr/bin/aws ; | |
} | |
forceRoot() { | |
[[ "$(id -u)" == "0" ]] || { echo "ERROR: Must run $0 as root." ; exit 1 ; } | |
} | |
main ; | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment