xyj70 / fusionpbx

Automatically exported from code.google.com/p/fusionpbx
0 stars 0 forks source link

Installation script doesn't check for location before testing with md5sum #315

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Following the steps from the wiki on a stock Debian Squeeze:

svn checkout https://fusionpbx.googlecode.com/svn/trunk/scripts/install/ubuntu/ 
/usr/src/install_fusionpbx
chmod 755 /usr/src/install_fusionpbx/install_fusionpbx.sh
ln -s /usr/src/install_fusionpbx/install_fusionpbx.sh /usr/local/bin/
sudo /usr/local/bin/install_fusionpbx.sh install-both user |tee 
/tmp/install_fusion.log

The installer complains of the md5sum of the latest script doesn't match, and 
offers to abort as per: 
<snip>
Codename:       squeeze
Do you want to continue [y|n]? y
Ok, this doesn't always work..,
  but we'll give it a go.
--2012-09-07 16:33:48--  
http://fusionpbx.googlecode.com/svn/trunk/scripts/install/ubuntu/install_fusionp
bx.sh
Resolving fusionpbx.googlecode.com... 74.125.31.82, 2404:6800:4008:c00::52
Connecting to fusionpbx.googlecode.com|74.125.31.82|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 92864 (91K) [text/plain]
Saving to: `/tmp/install_fusionpbx.latest'

100%[===========================================================================
================================================================================
========================================>] 92,864       177K/s   in 0.5s

2012-09-07 16:33:49 (177 KB/s) - `/tmp/install_fusionpbx.latest' saved 
[92864/92864]

md5sum: /root/install_fusionpbx.sh: No such file or directory
The md5sum of the current script is:
The md5sum of the latest script is: 0aba4a8ff20b7de81c9db6ca226659e6
There is a new version of this script.
  It is PROBABLY a good idea use the new version
  the new file is saved in /tmp/install_fusionpbx.latest
  to see the difference, run:
  diff -y /tmp/install_fusionpbx.latest /root/install_fusionpbx.sh
Continue [y/N]? ^C
</snip>

The location /root/install_fusionpbx.sh appears to be hard coded; a manual 
"fix":

root@t4b-fs1:~# ln -s /usr/src/install_fusionpbx/install_fusionpbx.sh /root/
root@t4b-fs1:~# ls -lsa /root/
total 28
4 drwx------  4 root root 4096 Sep  7 16:34 .
4 drwxr-xr-x 22 root root 4096 Sep  5 22:31 ..
4 drwx------  2 root root 4096 Sep  5 22:31 .aptitude
4 -rw-------  1 root root   47 Sep  7 16:22 .bash_history
4 -rw-r--r--  1 root root  570 Feb  1  2010 .bashrc
0 lrwxrwxrwx  1 root root   47 Sep  7 16:34 install_fusionpbx.sh -> 
/usr/src/install_fusionpbx/install_fusionpbx.sh
4 -rw-r--r--  1 root root  140 Nov 20  2007 .profile
4 drwxr-xr-x  3 root root 4096 Sep  7 16:32 .subversion
root@t4b-fs1:~#  sudo /usr/local/bin/install_fusionpbx.sh install-both user 
|tee /tmp/install_fusion.log
Good, you are root.
Internet connection is working, continuing!
OK you're running Debian Squeeze.  This script is known to work
   with apache/nginx and mysql|sqlite|postgres8 options
   Please consider providing feedback on repositories for nginx
   and php-fpm.

This script was written for Ubuntu 10.04 LTS codename Lucid

Your OS appears to be:
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 6.0.5 (squeeze)
Release:        6.0.5
Codename:       squeeze
Do you want to continue [y|n]? y
Ok, this doesn't always work..,
  but we'll give it a go.
--2012-09-07 16:34:59--  
http://fusionpbx.googlecode.com/svn/trunk/scripts/install/ubuntu/install_fusionp
bx.sh
Resolving fusionpbx.googlecode.com... 74.125.31.82, 2404:6800:4008:c00::52
Connecting to fusionpbx.googlecode.com|74.125.31.82|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 92864 (91K) [text/plain]
Saving to: `/tmp/install_fusionpbx.latest'

100%[===========================================================================
================================================================================
========================================>] 92,864       185K/s   in 0.5s

2012-09-07 16:34:59 (185 KB/s) - `/tmp/install_fusionpbx.latest' saved 
[92864/92864]

The md5sum of the current script is: 0aba4a8ff20b7de81c9db6ca226659e6
The md5sum of the latest script is: 0aba4a8ff20b7de81c9db6ca226659e6
files are the same, continuing
Upgrading the system, and adding the necessary dependencies for a FreeSWITCH 
compile

Original issue reported on code.google.com by tec...@gmail.com on 7 Sep 2012 at 4:43

GoogleCodeExporter commented 9 years ago
Assign to James Rose.

Original comment by markjcrane@gmail.com on 18 Sep 2012 at 1:50

GoogleCodeExporter commented 9 years ago
It is not hard coded, but I agree it does not always work as expected.  To the 
best of my knowledge there is not a sure fire way to get the exact path to a 
script that's running (from inside the script itself).  Here's how I've taken 
the approach:

#Check for new version
WHEREAMI=$(echo "`pwd`/`basename $0`")
wget $URLSCRIPT -O /tmp/install_fusionpbx.latest
CURMD5=$(md5sum "$WHEREAMI" | sed -e "s/\ .*//")
echo "The md5sum of the current script is: $CURMD5"

If you know of a better way, I'd appreciate the knowledge.

Original comment by James.O....@gmail.com on 18 Sep 2012 at 2:30

GoogleCodeExporter commented 9 years ago
2 years un delt with no updates closing

Original comment by r.ne...@gmail.com on 10 Dec 2014 at 7:51