Skip to content
Snippets Groups Projects
Select Git revision
  • 311567fa1a73c5066f69e703acfcf2585e980967
  • master default
2 results

alias

Blame
    • nimrod's avatar
      311567fa
      AWS assume-role script. · 311567fa
      nimrod authored
      To run commands with a different IAM user/ role. No other configuration
      needed (unlike aws-vault, not to pick on them, it's actually quite
      nice). Also, an AWS CLI alias.
      311567fa
      History
      AWS assume-role script.
      nimrod authored
      To run commands with a different IAM user/ role. No other configuration
      needed (unlike aws-vault, not to pick on them, it's actually quite
      nice). Also, an AWS CLI alias.
    entrypoint 372 B
    #!/bin/sh
    set -eu
    
    [ "$(id -u)" = "0" ] || { echo "Not running as root, continuing as the current user."; eval exec "$@"; }
    command -v stat > /dev/null || { echo "Can't find stat, exiting."; exit 1; }
    command -v gosu > /dev/null || { echo "Can't find gosu, exiting."; exit 1; }
    uid="$(stat Podcasts -c '%u')"
    gid="$(stat Podcasts -c '%g')"
    eval exec gosu "$uid:$gid" "$@"