RoverWire / virtualhost

Bash Script to easy create or delete apache virtual hosts on ubuntu
929 stars 544 forks source link

Virtual host creation problem under ubuntu #69

Open lulu5-c opened 3 years ago

lulu5-c commented 3 years ago

Good evening to all. Please help me, I have encountered the same error, I have cloned your project, followed your instructions but I encounter this error. My operating system ubuntu 20.04

houngbemey@houngbemey-HP-ProBook-450-G6:~$ sudo sh /home/houngbemey/virtualhost/virtualhost.sh create smartenterprise.site /home/houngbemey/virtualhost/virtualhost.sh: 30: [: smartenterprise.site: unexpected operator /home/houngbemey/virtualhost/virtualhost.sh: 36: [: unexpected operator /home/houngbemey/virtualhost/virtualhost.sh: 41: [[: not found /home/houngbemey/virtualhost/virtualhost.sh: 47: [: create: unexpected operator -e $This domain does not exist. Please try another one

RoverWire commented 2 years ago

Let me check this, probably is a typo error.

sam2de commented 2 years ago

Is there any updates on this issue, I'm ruining into the same error

pr0way commented 2 years ago

If you running this script via bash everything work fine.

sudo /path/to/virtualhost.sh create example.local

Under Ubuntu (Debian also I guess) if you run something with sh you get dash interpreter (not bash). In other words /bin/sh is a symlink to /bin/dash which one have own quirks as any other shell.

This is simple #70 fix for this issue ;)