Skip to content

Commit

Permalink
Merge branch 'feature/vhost_maintenance' of github.com:andrefs/gb-sys…
Browse files Browse the repository at this point in the history
…menu into develop
  • Loading branch information
andrefs committed Aug 24, 2011
2 parents 3b88a97 + 82c7b90 commit 9db25b1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gb.b_vhmaint
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ while [ "$CHOICE" == "NO" ]; do
echo -e "${sitelist[@]}" |\
nl |\
perl -plne 's/^\s+(\d+)\s+/ [$1]\t/g' |\
cat - <(echo ""; echo "[M] Maintenance all"; echo "[U] Up all"; echo "[X] Cancel") |\
cat - <(echo ""; echo "[M] All_maintenance"; echo "[U] All_up"; echo "[X] Cancel") |\
column -t
fi
read -p "Choose a site to toggle its maintenance status: " -e NUMBER
Expand All @@ -65,24 +65,24 @@ while [ "$CHOICE" == "NO" ]; do
SITE=$(ls -1 "$HOME/public_html" | grep -v "$CURSITE" | head -$NUMBER | tail -1)
fi
if [ -e "$HOME/public_html/$SITE/site_files/public/index.html" ]; then
#rm "$HOME/public_html/$SITE/site_files/public/index.html"
rm "$HOME/public_html/$SITE/site_files/public/index.html"
echo "Removed index.html from $SITE. Rails app should be working now."
else
#cp "$GBSYSMENUPATH/vhmaint.html" "$HOME/public_html/$SITE/site_files/public/index.html"
cp "$GBSYSMENUPATH/vhmaint.html" "$HOME/public_html/$SITE/site_files/public/index.html"
echo "Created index.html. 'Site under maintenace' page should be visible at $SITE."
fi
CHOICE='YES'
;;
M|m) # Put all sites under maintenance
for SITE in $(ls -1 "$HOME/public_html"); do
#cp "$GBSYSMENUPATH/vhmaint.html" "$HOME/public_html/$SITE/site_files/public/index.html"
cp "$GBSYSMENUPATH/vhmaint.html" "$HOME/public_html/$SITE/site_files/public/index.html"
echo "Created index.html. 'Site under maintenace' page should be visible at $SITE."
done
CHOICE='YES'
;;
U|u) # Put all sites up (remove maintenance warning)
for SITE in $(ls -1 "$HOME/public_html"); do
#rm -f "$HOME/public_html/$SITE/site_files/public/index.html"
rm -f "$HOME/public_html/$SITE/site_files/public/index.html"
echo "Removed index.html from $SITE. Rails app should be working now."
done
CHOICE='YES'
Expand All @@ -94,10 +94,10 @@ while [ "$CHOICE" == "NO" ]; do
else
CURSITE=$("$GBSYSMENUPATH/gb.a_location")
if [ -e "$HOME/public_html/$CURSITE/site_files/public/index.html" ]; then
#rm "$HOME/public_html/$CURSITE/site_files/public/index.html"
rm "$HOME/public_html/$CURSITE/site_files/public/index.html"
echo "Removed index.html from $CURSITE. Rails app should be working now."
else
#cp "$GBSYSMENUPATH/vhmaint.html" "$HOME/public_html/$CURSITE/site_files/public/index.html"
cp "$GBSYSMENUPATH/vhmaint.html" "$HOME/public_html/$CURSITE/site_files/public/index.html"
echo "Created index.html. 'Site under maintenace' page should be visible at $CURSITE."
fi
CHOICE='YES'
Expand Down

0 comments on commit 9db25b1

Please sign in to comment.