Sha256: 1c7f913087b57814678995d570e1a7d0c6ce8a86a2c9028fe4f1a675a0b35ad0

Contents?: true

Size: 997 Bytes

Versions: 26

Compression:

Stored size: 997 Bytes

Contents

#!/bin/bash --login
# USE THIS SCRIPT WHEN UPGRADING RUBY
if [[ -d '/opt/pwn' ]]; then
  pwn_root='/opt/pwn' 
else
  pwn_root="${PWN_ROOT}"
fi

function usage() {
  echo $"Usage: $0 <new ruby version e.g. 2.4.4> <optional bool running from build_pwn_gem.sh>"
  exit 1
}

source /etc/profile.d/rvm.sh

new_ruby_version=$1
if [[ $2 != '' ]]; then
  old_ruby_version=$2
else
  old_ruby_version=`cat ${pwn_root}/.ruby-version`
fi

ruby_gemset=`cat ${pwn_root}/.ruby-gemset`

if [[ $# < 1 ]]; then
  usage
fi

# Upgrade RVM
curl -sSL https://rvm.io/mpapis.asc | sudo gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | sudo gpg2 --import -
export rvmsudo_secure_path=1
rvmsudo rvm get latest
rvm reload

# Install New Version of RubyGems & Ruby
cd $pwn_root && ./vagrant/provisioners/gem.sh
rvmsudo rvm install ruby-$new_ruby_version
echo $new_ruby_version > $pwn_root/.ruby-version

cd / && cd $pwn_root && rvm use $new_ruby_version@$ruby_gemset && ./build_pwn_gem.sh
rvmsudo gem pristine --all

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
pwn-0.4.614 upgrade_ruby.sh
pwn-0.4.613 upgrade_ruby.sh
pwn-0.4.612 upgrade_ruby.sh
pwn-0.4.611 upgrade_ruby.sh
pwn-0.4.610 upgrade_ruby.sh
pwn-0.4.609 upgrade_ruby.sh
pwn-0.4.608 upgrade_ruby.sh
pwn-0.4.607 upgrade_ruby.sh
pwn-0.4.606 upgrade_ruby.sh
pwn-0.4.605 upgrade_ruby.sh
pwn-0.4.604 upgrade_ruby.sh
pwn-0.4.603 upgrade_ruby.sh
pwn-0.4.594 upgrade_ruby.sh
pwn-0.4.593 upgrade_ruby.sh
pwn-0.4.592 upgrade_ruby.sh
pwn-0.4.590 upgrade_ruby.sh
pwn-0.4.588 upgrade_ruby.sh
pwn-0.4.587 upgrade_ruby.sh
pwn-0.4.586 upgrade_ruby.sh
pwn-0.4.585 upgrade_ruby.sh