Sha256: 9e43d0f42ba8d9583df94403a0081f7dbbab1fa67a72a5907d2836d1244e35f4

Contents?: true

Size: 1.7 KB

Versions: 1450

Compression:

Stored size: 1.7 KB

Contents

#!/bin/bash --login
pwn_env_file='/etc/profile.d/pwn_envs.sh'
pwn_provider=`echo $PWN_PROVIDER`

if [[ $pwn_provider == 'docker' ]]; then
  apt update && apt install -y sudo screen apt-utils
  # echo 'Set disable_coredump false' >> /etc/sudoers
else
  sudo apt update && sudo apt install -y screen apt-utils
fi

sudo tee -a $pwn_env_file << EOF
export PWN_ROOT=\$(
  source /etc/profile.d/rvm.sh; \
  if [[ -d '/opt/pwn' ]]; then \
    printf '/opt/pwn'; \
  else \
    ruby -r pwn -e 'puts "#{Gem.path.first}/gems/pwn-#{PWN::VERSION}"' \
    2> /dev/null; \
  fi
)
export PWN_PROVIDER='${pwn_provider}'
EOF

sudo tee -a /etc/profile.d/globals.sh << 'EOF'
#!/bin/bash --login
export DEBIAN_FRONTEND=noninteractive
export TERM=xterm

screen_session=`basename -- ${0} .sh`
screen_cmd="screen -T xterm -L -S ${screen_session} -d -m sudo /bin/bash --login -c"
assess_update_errors='|| echo IMAGE_ABORT && exit 1'
debconf_set='/usr/bin/debconf-set-selections'
apt="DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confnew'"

grok_error() {
  while true; do
    # Wait until screen exits session
    screen -ls | grep $screen_session
    if [[ $? == 1 ]]; then
      grep IMAGE_ABORT screenlog.*
      if [[ $? == 0 ]]; then
        echo "Failures encountered in $(ls screenlog.*) for ${screen_session} session!!!"
        cat screenlog.*
        rm screenlog.*
        exit 1
      else
        echo "No errors in $(ls screenlog.*) detected...moving onto the next."
        ls screenlog.* > /dev/null 2>&1
        if [[ $? == 0 ]]; then
          rm screenlog.*
        fi
        break
      fi
    else
      printf '.'
      sleep 9
    fi
  done
}
EOF

sudo chmod 755 /etc/profile.d/globals.sh

Version data entries

1,450 entries across 725 versions & 1 rubygems

Version Path
pwn-0.5.193 packer/provisioners/upload_globals.sh
pwn-0.5.193 vagrant/provisioners/upload_globals.sh
pwn-0.5.192 packer/provisioners/upload_globals.sh
pwn-0.5.192 vagrant/provisioners/upload_globals.sh
pwn-0.5.191 packer/provisioners/upload_globals.sh
pwn-0.5.191 vagrant/provisioners/upload_globals.sh
pwn-0.5.190 packer/provisioners/upload_globals.sh
pwn-0.5.190 vagrant/provisioners/upload_globals.sh
pwn-0.5.189 vagrant/provisioners/upload_globals.sh
pwn-0.5.189 packer/provisioners/upload_globals.sh
pwn-0.5.188 packer/provisioners/upload_globals.sh
pwn-0.5.188 vagrant/provisioners/upload_globals.sh
pwn-0.5.187 packer/provisioners/upload_globals.sh
pwn-0.5.187 vagrant/provisioners/upload_globals.sh
pwn-0.5.186 packer/provisioners/upload_globals.sh
pwn-0.5.186 vagrant/provisioners/upload_globals.sh
pwn-0.5.185 packer/provisioners/upload_globals.sh
pwn-0.5.185 vagrant/provisioners/upload_globals.sh
pwn-0.5.184 packer/provisioners/upload_globals.sh
pwn-0.5.184 vagrant/provisioners/upload_globals.sh