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.214 vagrant/provisioners/upload_globals.sh
pwn-0.5.214 packer/provisioners/upload_globals.sh
pwn-0.5.213 packer/provisioners/upload_globals.sh
pwn-0.5.213 vagrant/provisioners/upload_globals.sh
pwn-0.5.212 packer/provisioners/upload_globals.sh
pwn-0.5.212 vagrant/provisioners/upload_globals.sh
pwn-0.5.211 packer/provisioners/upload_globals.sh
pwn-0.5.211 vagrant/provisioners/upload_globals.sh
pwn-0.5.210 packer/provisioners/upload_globals.sh
pwn-0.5.210 vagrant/provisioners/upload_globals.sh
pwn-0.5.209 packer/provisioners/upload_globals.sh
pwn-0.5.209 vagrant/provisioners/upload_globals.sh
pwn-0.5.207 packer/provisioners/upload_globals.sh
pwn-0.5.207 vagrant/provisioners/upload_globals.sh
pwn-0.5.206 packer/provisioners/upload_globals.sh
pwn-0.5.206 vagrant/provisioners/upload_globals.sh
pwn-0.5.205 packer/provisioners/upload_globals.sh
pwn-0.5.205 vagrant/provisioners/upload_globals.sh
pwn-0.5.204 packer/provisioners/upload_globals.sh
pwn-0.5.204 vagrant/provisioners/upload_globals.sh