~ubuntu-branches/ubuntu/feisty/asterisk/feisty-security

« back to all changes in this revision

Viewing changes to debian/asterisk_fix

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Porcheron
  • Date: 2007-01-28 01:08:48 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070128010848-fd6k14jk4nw0drs5
Tags: 1:1.2.14~dfsg-4ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/asterisk.init:
    + create /var/run/ directory if necessary and set proper permissions
  - debian/asterisk.default - fix -D/-d typo in PARAMS (Closes LP#68169)
  - debian/patches/ubuntu_safe_asterisk - remove bashism (Closes LP#68742)
* debian/asterisk.init - fixed stopping stop while RUNASTSAFE=yes

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        fi
24
24
done
25
25
 
 
26
# Update from /usr/share/asterisk/sounds/priv-callerintros to 
 
27
#             /var/lib/asterisk/sounds/priv-callerintros
 
28
if [ -d /usr/share/asterisk/sounds/priv-callerintros ];then
 
29
        if [ -L /usr/share/asterisk/sounds/priv-callerintros ];then
 
30
                # if this is a fresh install just try to move the symlink.
 
31
                userprovided=0
 
32
                if [ ! -L /var/lib/asterisk/sounds/priv-callerintros ];then
 
33
                        if [ `find /var/lib/asterisk/sounds/priv-callerintros -mindepth 1|wc -l` -gt 0 ];then
 
34
                                rmdir /var/lib/asterisk/sounds/priv-callerintros
 
35
                                echo -n "Updating private callerintros location to /var/lib/asterisk/sounds/priv-callerintros"
 
36
                                ln -s `readlink /usr/share/asterisk/sounds/priv-callerintros` /var/lib/asterisk/sounds/priv-callerintros
 
37
                                rm /usr/share/asterisk/sounds/priv-callerintros
 
38
                                echo '.'
 
39
                        else
 
40
                                userprovided=1
 
41
                        fi
 
42
                else
 
43
                        userprovided=1
 
44
                fi
 
45
                if [ "$userprovided" = "1" ];then
 
46
                        echo 'Found user installed private callerintros. Not updating private callerintros'
 
47
                        echo 'directory to new directory. Please adjust symlink manually to new location'
 
48
                        echo '/var/lib/asterisk/sounds/priv-callerintros.'
 
49
                fi
 
50
        else
 
51
                echo -n "Updating private callerintros location to /var/lib/asterisk/sounds/priv-callerintros"
 
52
                find /usr/share/asterisk/sounds/priv-callerintros -mindepth 1 -maxdepth 1 -exec mv "'{}'" /var/lib/asterisk/sounds/priv-callerintros \;
 
53
                rmdir /usr/share/asterisk/sounds/priv-callerintros
 
54
                echo "."
 
55
        fi
 
56
fi
 
57
 
26
58
# Make sure all (possibly) used dirs exist and is owned by asterisk
27
59
 
28
60
# /var/run/asterisk is not yet handled by init.d :-(
37
69
"
38
70
 
39
71
subdirs="
 
72
        /var/lib/asterisk/sounds/priv-callerintros
40
73
        /var/log/asterisk/cdr-csv
41
74
        /var/log/asterisk/cdr-custom
42
75
        /var/spool/asterisk/dictate
74
107
####################################
75
108
# If asterisk in running, reload it
76
109
# otherwise start it
77
 
if [ -f "/etc/init.d/asterisk" ];then
 
110
if [ -x "/etc/init.d/asterisk" ];then
78
111
        if [ -f /var/run/asterisk/asterisk.pid ];then
79
112
            invoke-rc.d asterisk reload || exit $?
80
113
        else