Commit dcf20626b5503d0e2832808de6b08afc26f2b7db

Authored by Antonio Terceiro
1 parent 685e9913

Adding a setup action to the initscript

Showing 1 changed file with 14 additions and 10 deletions   Show diff stats
etc/init.d/noosfero
... ... @@ -50,14 +50,7 @@ main_script() {
50 50 fi
51 51 }
52 52  
53   -do_start() {
54   -
55   - # FIXME should not test for ferret only
56   - if [ -e $FERRET_PID_FILE ]; then
57   - echo 'noosfero already running, cannot start.'
58   - exit 2
59   - fi
60   -
  53 +do_setup() {
61 54 # PID directories
62 55 if [ ! -d /var/run/noosfero ]; then
63 56 mkdir /var/run/noosfero
... ... @@ -89,6 +82,17 @@ do_start() {
89 82 if [ ! -e $NOOSFERO_DIR/log ]; then
90 83 ln -s /var/log/noosfero $NOOSFERO_DIR/log
91 84 fi
  85 +}
  86 +
  87 +do_start() {
  88 +
  89 + # FIXME should not test for ferret only
  90 + if [ -e $FERRET_PID_FILE ]; then
  91 + echo 'noosfero already running, cannot start.'
  92 + exit 2
  93 + fi
  94 +
  95 + do_setup
92 96  
93 97 # actually start the service
94 98 main_script start
... ... @@ -111,11 +115,11 @@ do_restart() {
111 115 }
112 116  
113 117 case "$1" in
114   - start|stop|restart)
  118 + start|stop|restart|setup)
115 119 do_$1
116 120 ;;
117 121 *)
118   - echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
  122 + echo "Usage: $SCRIPTNAME {start|stop|restart|setup}" >&2
119 123 exit 3
120 124 ;;
121 125 esac
... ...