ExamarCorp / ovz-web-panel

Automatically exported from code.google.com/p/ovz-web-panel
Other
0 stars 0 forks source link

double slashes ("//") and bash variable syntax #481

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Before I correct you on very trivial, nearly meaningless things I'd like to say 
I'm very grateful for your work on this project and I use it daily. Thanks!

These are almost purely cosmetic "issues" with the bash scripts I've seen:
- In owp.conf (and the bash scripts themselves) you define INSTALL_DIR with a 
trailing forward slash ("/")

- Then when you call the variable later it looks like so: $INSTALL_DIR/path.

- Proper would be to define it without a trailing slash so there's only one 
slash later on, and to contain the variable in {} so there's no mistaking where 
the variable name ends. For exmaple (from /etc/init.d/owp, but modified):

# configuration defaults
if [ -f `dirname $0`/../script/owp ]; then
  INSTALL_DIR=`dirname $0`/..
else
  INSTALL_DIR="/opt/ovz-web-panel"
fi

...
    else
      echo_ok "Web server was stopped."
      ruby ${INSTALL_DIR}/script/runner -e production  "BackgroundJob.stop_running" > /dev/null 2>&1
    fi

...
EOF

Although it runs fine now, just a couple simple cosmetic changes to make it 
prettier and easier to read/modify.

Thanks for your time and again on the efforts at making a usable web panel! 
(It's not easy!)

-B

Original issue reported on code.google.com by intentio...@gmail.com on 4 Dec 2012 at 4:40

GoogleCodeExporter commented 9 years ago

Original comment by sibprogrammer on 17 Jan 2013 at 12:49