/usr/local/bin/els: line 2937: [: !=: unary operator expected
if [ $DOALL != 1 ]; then
if [ "$DOALL" != 1 ]; then
Thank you, I tried that and no go.Try chattr +a .bash_profile and then try editing it.
Thanks,
Grant
Thank you, I tried that and no go.
Try:
Code:# cd /usr/local/els # rm -f roundcube.sh # wget http://servermonkeys.com/projects/els/els/roundcube.sh # chmod 750 roundcube.sh # els --roundcube
--- roundcube.sh 2007-02-15 16:30:48.000000000 -0500
+++ roundcube.sh1 2007-02-15 21:51:20.000000000 -0500
@@ -9,7 +9,7 @@
ROUNDCUBE_DB=da_roundcube
ROUNDCUBE_DB_USER=da_roundcube
ROUNDCUBE_DB_PASS=`perl -le'print map+(A..Z,a..z,0..9)[rand 62],0..7'`;
-ROUNDCUBEVERSION=0.1beta2.2
+ROUNDCUBEVERSION=0.1beta2.1
ROUNDCUBETARVERSION=0.1beta2
MYSQLUSER=`grep "^user=" $MYSQL_CONF_PATH | cut -d= -f2`
MYSQLPASSWORD=`grep "^passwd=" $MYSQL_CONF_PATH | cut -d= -f2`
@@ -45,26 +45,28 @@
echo "Roundcube has already been downloaded, skipping step."
fi
-if [ -d roundcube-backup ]; then
+if [[ -d roundcube-backup ]]; then
rm -rf roundcube-backup
-else
+elif [[ -e roundcube-backup ]]; then
rm -rf roundcube
mv roundcube* roundcube-backup
fi
-tar xzf roundcube-$ROUNDCUBEVERSION.tar.gz
+tar -xzf roundcubemail-$ROUNDCUBEVERSION.tar.gz
# Remove archive and link roundcube folder to roundcube
ln -s roundcubemail-$ROUNDCUBETARVERSION roundcube
+mkdir roundcube/apache
+
# Chmod needed directories
echo "Chmoding needed directories..."
chown -R root:root $ROUNDCUBEPATH
cd roundcube
-chown -R apache $ROUNDCUBEPATH/temp $ROUNDCUBEPATH/logs $ROUNDCUBEPATH/db.inc.php
+chown -R root:root apache temp logs config/db.inc.php.dist
chmod -R 700 temp
chmod -R 700 logs
-chmod 600 db.inc.php
+chmod 600 config/db.inc.php.dist
# Insert data to mysql and create database/user for roundcube
if [ ! -d /var/lib/mysql/$ROUNDCUBE_DB ]; then
@@ -78,27 +80,23 @@
fi
# Edit roundcube configuration
-COUNTEDIT=`$GREP -c -e "mysql://roundcube:pass@localhost/roundcubemail" db.inc.php`
-elif [ -d roundcube-backup ]; then
+if [[ -d roundcube-backup ]]; then
echo "Roundcube backup directory exists (roundcube-backup). Moving configuraiton files..."
mv --force ../roundcube-backup/config/db.inc.php config/db.inc.php
mv --force ../roundcube-backup/config/main.inc.php config/main.inc.php
-elif [ "$COUNEDIT" = "0" ]; then
+else
echo "Editing roundcube configuration..."
cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php
- perl -pi -e "s|mysql://roundcube:pass@localhost/roundcubemail|mysql://$ROUNDCUBE_DB_USER:$ROUNDCUBE_DB_PASS@localhost/$ROUNDCUBE_DB|" > db.inc.php > /dev/null
- perl -pi -e "s|'enable_caching'] = TRUE|'enable_caching'] = FALSE|" main.inc.php > /dev/null
- perl -pi -e "s|'default_host'] = ''|'default_host'] = 'localhost'|" main.inc.php > /dev/null
+ sed -i "s|mysql://roundcube:pass@localhost/roundcubemail|mysql://$ROUNDCUBE_DB_USER:$ROUNDCUBE_DB_PASS@localhost/$ROUNDCUBE_DB|" db.inc.php
+ sed -i "s|\['enable_caching'\] = TRUE|\['enable_caching'\] = FALSE|" main.inc.php
+ sed -i "s|\['default_host'\] = ''|\['default_host'\] = 'localhost'|" main.inc.php
echo "Roundcube has been installed successfully"
-else
- echo "Can not edit configuration file."
- exit
fi
# Writing alias to httpd.conf
-COUNTALIAS=`$GREP -c -e "Alias /roundcube" $HTTPDCONF`
+COUNTALIAS=$(grep -c -e "Alias /roundcube" $HTTPDCONF)
if [ "$COUNTALIAS" = "0" ]; then
echo "" >> $HTTPDCONF
echo "# Modified by ELS" >> $HTTPDCONF