Skip to content

Commit

Permalink
adding more conditions around debian scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyeal committed Oct 17, 2018
1 parent 1c41104 commit 38ce330
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Formula/aws-rotate-iam-keys.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class AwsRotateIamKeys < Formula
desc "Automatically set up a cron job to rotate your IAM keys"
homepage "https://aws-rotate-iam-keys.com"
url "https://github.com/rhyeal/aws-rotate-iam-keys/archive/v0.3.tar.gz"
url "https://github.com/rhyeal/aws-rotate-iam-keys/archive/v0.3.1.tar.gz"
sha256 "969d530b29f8a6264de0df98a0276629f4cb4d843dfd5c05f7b81d7576156ec9"
depends_on "awscli"
depends_on "jq"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Requires [Homebrew](https://brew.sh/) to install. I am hoping to be included in
### Other Linux

```
wget -q https://github.com/rhyeal/aws-rotate-iam-keys/blob/master/aws-rotate-iam-keys_0.3.deb -o aws-rotate-iam-keys.deb
wget -q https://github.com/rhyeal/aws-rotate-iam-keys/blob/master/aws-rotate-iam-keys_0.3.1.deb -o aws-rotate-iam-keys.deb
sudo dpkg -i aws-rotate-iam-keys.deb
sudo apt-get install -f
rm aws-rotate-iam-keys.deb # optional file clean up
Expand Down Expand Up @@ -179,7 +179,7 @@ in a snazzy single-page UI. It's basically this README with some colors.

### Linux
```
echo 693546930ba41559f4391731988ffa04 aws-rotate-iam-keys.0.3.deb | md5sum --check -
echo 693546930ba41559f4391731988ffa04 aws-rotate-iam-keys.0.3.1.deb | md5sum --check -
```
### MacOS

Expand Down
Binary file removed aws-rotate-iam-keys.0.2.5.deb
Binary file not shown.
Binary file added aws-rotate-iam-keys.0.3.1.deb
Binary file not shown.
Binary file removed aws-rotate-iam-keys.0.3.deb
Binary file not shown.
Binary file removed aws-rotate-iam-keys_0.2.5.tar.gz
Binary file not shown.
Binary file removed aws-rotate-iam-keys_0.2.5.zip
Binary file not shown.
Binary file added aws-rotate-iam-keys_0.3.1.tar.gz
Binary file not shown.
Binary file added aws-rotate-iam-keys_0.3.1.zip
Binary file not shown.
Binary file removed aws-rotate-iam-keys_0.3.tar.gz
Binary file not shown.
Binary file removed aws-rotate-iam-keys_0.3.zip
Binary file not shown.
6 changes: 6 additions & 0 deletions src/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
aws-rotate-iam-keys (0.3.1) bionic; urgency=medium

* Adding more conditions around debian scripts

-- Adam Link <aws-rotate-iam-keys@rhyeal.com> Wed, 17 Oct 2018 13:32:45 -0800

aws-rotate-iam-keys (0.3) bionic; urgency=medium

* New exit condition on invalid keys
Expand Down
2 changes: 1 addition & 1 deletion src/debian/files
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aws-rotate-iam-keys_0.3_source.buildinfo utils -
aws-rotate-iam-keys_0.3.1_source.buildinfo utils -
6 changes: 4 additions & 2 deletions src/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ else
exit 1
fi

line="$((RANDOM%60)) 2 * * * /usr/bin/aws-rotate-iam-keys --profile default >/dev/null 2>&1 #rotate AWS keys daily"
(crontab -u $MY_USER -l; echo "$line" ) | crontab -u $MY_USER -
if [[ "$MY_USER" != "" ]]; then
line="$((RANDOM%60)) 2 * * * /usr/bin/aws-rotate-iam-keys --profile default >/dev/null 2>&1 #rotate AWS keys daily"
(crontab -u $MY_USER -l; echo "$line" ) | crontab -u $MY_USER -
fi
7 changes: 4 additions & 3 deletions src/debian/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ elif [[ "$USER" != "root" && "$USER" != "" ]]; then
elif [[ "$SUDO_USER" != "root" && "$SUDO_USER" != "" ]]; then
MY_USER=$SUDO_USER
else
echo "Cannot find the username! Panicking and exiting..."
exit 1
echo "Cannot find the username! Skipping the crontab removal"
fi

crontab -u $MY_USER -l | grep -v '/usr/bin/aws-rotate-iam-keys --profile default' | crontab -u $MY_USER -
if [[ "$MY_USER" != "" ]]; then # if this is being run as a user, remove this line from cron tab
crontab -u $MY_USER -l | grep -v '/usr/bin/aws-rotate-iam-keys --profile default' | crontab -u $MY_USER -
fi
2 changes: 1 addition & 1 deletion website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h1 class="cover-heading padding-top">Secure AWS IAM. Finally.</h1>
Other Linux
</div>
<div class="col-md-8 vertical-align">
<pre style="clear:both;text-align:left;margin-bottom:0.9em"><code id="selectable" onclick="selectText(this)">wget -q https://github.com/rhyeal/aws-rotate-iam-keys/blob/master/aws-rotate-iam-keys_0.3.deb -o aws-rotate-iam-keys.deb<br/>sudo dpkg -i aws-rotate-iam-keys.deb<br/>sudo apt-get install -f<br/>rm aws-rotate-iam-keys.deb # optional file clean up</code></pre>
<pre style="clear:both;text-align:left;margin-bottom:0.9em"><code id="selectable" onclick="selectText(this)">wget -q https://github.com/rhyeal/aws-rotate-iam-keys/blob/master/aws-rotate-iam-keys_0.3.1.deb -o aws-rotate-iam-keys.deb<br/>sudo dpkg -i aws-rotate-iam-keys.deb<br/>sudo apt-get install -f<br/>rm aws-rotate-iam-keys.deb # optional file clean up</code></pre>
</div>
</div>
<div class="row">
Expand Down

0 comments on commit 38ce330

Please sign in to comment.