Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'develop' of github.com:andrefs/gb-sysmenu into feature/…

…install
  • Loading branch information...
commit 110896c3018a1fc66c0184df128c37dcc72b0c80 2 parents cacc4b9 + 9db25b1
@andrefs andrefs authored
View
20 gb.a_check_envvars
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -e
+
+checkvar(){
+ vname="$1"
+ vval="$2"
+ if [ -z "$vval" ]; then
+ echo "It appears that you don't have the \$$vname environmental variable set."
+ echo "This script requires that \$$vname is defined in order to execute."
+ echo
+ echo "Please run the gb.b_install script or manually set \$$vname."
+ exit 1
+ fi
+}
+
+checkvar "GBSYSMENUPATH" "$GBSYSMENUPATH"
+checkvar "GBSITESDIR" "$GBSITESDIR"
+
+exit 0
View
4 gb.m_vhmanage/gb.b_addvh
@@ -84,8 +84,8 @@ echo "
" | sudo tee /etc/apache2/sites-available/$DOMAIN > /dev/null
-read -p "Do you want to configure this Virtual Host to use SSL? [Y/n] "
-if [[ "$REPLY" != "n" && "$REPLY" != "N" ]]; then
+read -p "Do you want to configure this Virtual Host to use SSL? [n/Y] "
+if [[ "$REPLY" == "y" || "$REPLY" == "Y" ]]; then
echo "Generating new RSA keys."
mkdir -p "$HOME/ssl_keys/$DOMAIN"
cd "$HOME/ssl_keys/$DOMAIN"
View
49 gb.m_vhmanage/gb.b_apps_reset
@@ -1,7 +1,26 @@
#!/bin/bash
+changed () {
+ gitf="$1"
+ localf="$2"
+ if ! [ -e "$localf" ]; then
+ return 1;
+ # echo "Local file '$localf' does not exist; copying..."
+ # chgdlist=(${chgdlist[@]-} $gitf)
+ elif [ "$gitf" -nt "$localf" ]; then
+ return 1;
+ # echo "Git version of '$site' is newer!"
+ # chgdlist=(${chgdlist[@]-} $gitf)
+ else
+ return 0;
+ # echo "No new changes to '$site'!"
+ fi
+}
+
+CURSITE=$("$GBSYSMENUPATH/gb.a_location")
+
if [ -z "$HANDYANTCONFIGDIR" ]; then
- HANDYANTCONFIGDIR='/home/naruto/HandyAnt-configs'
+ HANDYANTCONFIGDIR='/home/hokage/gb-instancies'
fi
cd "$HANDYANTCONFIGDIR"
@@ -12,17 +31,27 @@ for gitf in $(ls *.yml); do
site=$(basename $gitf)
site=${site/.yml/}
localf="$HOME/public_html/$site/site_files/config/config.yml"
-
- if ! [ -e "$localf" ]; then
- echo "Local file '$localf' does not exist; copying..."
- chgdlist=(${chgdlist[@]-} $gitf)
- elif [ "$gitf" -nt "$localf" ]; then
- echo "Git version of '$site' is newer!"
+
+ changed "$gitf" "$localf"
+ if [ $? -eq 1 ]; then
chgdlist=(${chgdlist[@]-} $gitf)
- else
- echo "No new changes to '$site'!"
fi
done
-echo "${chgdlist[@]-}"
+# echo "${chgdlist[@]-}"
+
+echo "The config files for these sites have changed. Which one do you want to update? [Cancel] "
+printf "%s\n" "${chgdlist[@]-}" | cat <(echo "All") - | perl -plne 's/^.*\///' | nl -v0 | perl -plne 's/\s+(\d+)\s+/ [$1] /g'
+
+# ls -1 /etc/apache2/sites-available | nl | perl -plne 's/\s+(\d+)\s+/ [$1] /g'
+# read -p "Which one do you want to change? [0 to quit] " -e NUMBER
+# while ! [[ "$NUMBER" =~ ^[0-9]+$ ]]; do
+# echo "$NUMBER is not a valid number."
+# ls -1 /etc/apache2/sites-available | nl | perl -plne 's/\s+(\d+)\s+/ [$1] /g'
+# read -p "Please enter the number of the site you want to change: [0 to quit] " -e NUMBER
+# done
+# if [ "$NUMBER" == "0" ]; then
+# echo "Operation canceled."
+# exit 0
+# fi
View
1  gb.m_vhmanage/gb.b_vhmaint
@@ -1,7 +1,6 @@
#!/bin/bash
# Toggles "site under maintenance" page on a vhost
-
# $GBSYSMENUPATH must be defined
if [ -z "$GBSYSMENUPATH" ]; then
echo "It appears that you don't have the \$GBSYSMENUPATH environmental variable set."
Please sign in to comment.
Something went wrong with that request. Please try again.