sh nuke-pj2.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh nuke-pj2.sh相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env bash

# Exit if error and pipe any from ctl commands
#set -eo

# Stop Pushy Server
chef-server-ctl stop opscode-pushy-server

# Nuke it from DB
echo "drop database opscode_pushy;" | su -l opscode-pgsql -c "psql"
echo "DROP ROLE opscode_pushy" | su -l opscode-pgsql -c "psql"
echo "DROP ROLE opscode_pushy_ro" | su -l opscode-pgsql -c "psql"

# Stop everyone else so we can remove runit refs without complaints on start
chef-server-ctl stop
systemctl stop private_chef-runsvdir-start.service

# Remove and purge
yum remove opscode-push-jobs-server -y

dirs="
/var/log/opscode/opscode-pushy-server
/var/opt/opscode-push-jobs-server
/opt/opscode-push-jobs-server
/etc/opscode-push-jobs-server
/opt/opscode/service/opscode-pushy-server
/opt/opscode/sv/opscode-pushy-server
/var/opt/opscode/nginx/etc/addon.d/10-push_jobs_upstreams.conf
/var/opt/opscode/nginx/etc/addon.d/10-push_jobs_external.conf
"

for ii in $dirs;do
  if [ -e $ii ];then
    echo "EXISTS $ii"
    rm -rf $ii
  else
    echo "NOPE $ii"
  fi
done

# Catch any outliers but prompt so no accidents
for ii in `find / -type d | grep push | grep -v 'dev-lxc' | egrep 'job|server'`;do 
  if [ -d $ii ];then
    echo "EXISTS $ii"
    rm -ri $ii
  else
    echo "NOPE"
  fi
done

# Up we go
systemctl start private_chef-runsvdir-start.service
sleep 2 
# Not necessary at all but a quasi-sanity check of sorts
chef-server-ctl restart
echo "Grep push from ps aux"
ps aux | grep push

以上是关于sh nuke-pj2.sh的主要内容,如果未能解决你的问题,请参考以下文章

sh MakeArchLinux-Rpi2.sh

sh habitat_plan_2.sh

sh node_build_2.sh

sh jupyter_notebook_ec2.sh

sh jupyter_notebook_ec2.sh

sh ec2-describe-list.sh