Modify

Opened 9 years ago

Closed 9 years ago

#44 closed defect (fixed)

./hostapd: 49: Syntax error: "(" unexpected

Reported by: Erik Grootjans Owned by: stappers@…
Priority: major Milestone: milestone:
Component: debian/rootfs Version: 2.0
Severity: Keywords:
Cc:

Description

Because emdebian is down, i'm using the build fs from debwrt.
In this file there are a few things to correct:

1) hostapd-mini has to be replaced by hostapd -- see also ticket 12
2) DAEMON_CONF" from /etc/hostapd-mini/wpa.conf to /etc/hostapd/hostapd-wpa.conf
3) function check() { to check() {

See down here for the corrected file:

===/etc/init.d/hostapd
#!/bin/sh

### BEGIN INIT INFO
# Provides: hostapd
# Required-Start:
# Required-Stop:
# Should-Start: $network
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Advanced IEEE 802.11 management daemon
# Description: Userspace IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP
# Authenticator
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
#DAEMON=/usr/sbin/hostapd-mini
DAEMON=/usr/sbin/hostapd
#NAME=hostapd-mini
NAME=hostapd
DESC="advanced IEEE 802.11 management"
#PIDFILE=/var/run/hostapd-mini.pid
PIDFILE=var/run/hostapd.pid

test -x $DAEMON
exit 0

#if [ -s /etc/default/hostapd-mini ] ; then
# . /etc/default/hostapd-mini
#fi
if [ -s /etc/default/hostapd ] ; then

. /etc/default/hostapd

fi

#if [ -z "$DAEMON_CONF" ]; then
# DAEMON_CONF=/etc/hostapd-mini/wpa.conf
#fi
if [ -z "$DAEMON_CONF" ]; then
# changed by Erik on 3 December 2010

DAEMON_CONF=/etc/hostapd/hostapd-wpa.conf

fi

DAEMON_OPTS="-B -P $PIDFILE $DAEMON_OPTS $DAEMON_CONF"

. /lib/lsb/init-functions

#Changed by Erik on 2 Dec 2010 for ... unexpected ( error
#function check() {
check() {

# exit if the kernel version is not 2.6
KVER=$(uname -r)
KMAJ=${KVER%${KVER#*.*[.]}}
KMAJ=${KMAJ%.}
if [ "$KMAJ" != "2.6" ]; then

echo
log_warning_msg "needs kernel 2.6 - no configuration possible";
log_end_msg 0
exit 0

fi

if ! ( cat /proc/net/dev | grep wlan0: >/dev/null 2>&1 ); then

echo; log_warning_msg "b43 wlan0 interface not found - no configuration possible"
log_action_end_msg 0;
exit 0;

fi

}

case "$1" in

start)

log_daemon_msg "Starting $DESC"
log_progress_msg "$NAME"
check
if [ "$RUN_DAEMON" != "yes" ]; then

# log_progress_msg "disabled via /etc/default/hostapd-mini"

log_progress_msg "disabled via /etc/default/hostapd"
log_end_msg 0
exit 0

fi
start-stop-daemon --start --oknodo --quiet \

--exec $DAEMON --pidfile $PIDFILE -- $DAEMON_OPTS > /dev/null

log_end_msg "$?"
;;

stop)

log_daemon_msg "Stopping $DESC"
log_progress_msg "$NAME"
check
start-stop-daemon --stop --oknodo --quiet \

--exec $DAEMON --pidfile $PIDFILE

log_end_msg "$?"
;;

*)

N=/etc/init.d/$NAME
echo "Usage: $N {start|stop}" >&2
exit 1
;;

esac

exit 0
root@debwrt:/etc/init.d#

Attachments (0)

Change History (5)

comment:1 Changed 9 years ago by amain

  • Status changed from new to accepted

comment:2 Changed 9 years ago by stappers

The same patch, now as unified diff:

--- debian/package/hostapd/debian/hostapd.init  (revision 140)
+++ debian/package/hostapd/debian/hostapd.init  (working copy)
@@ -33,7 +33,7 @@
 
 . /lib/lsb/init-functions
 
-function check() {
+check() {
         # exit if the kernel version is not 2.6
         KVER=$(uname -r)
         KMAJ=${KVER%${KVER#*.*[^.]}}

comment:3 Changed 9 years ago by amain

  • Owner changed from amain to stappers@…
  • Status changed from accepted to assigned

patch accepted...Geert please commit to svn

comment:4 Changed 9 years ago by stappers

Commited to the staging SVN

comment:5 Changed 9 years ago by amain

  • Resolution set to fixed
  • Status changed from assigned to closed

Assuming fixed. Closing ticket.

Add Comment

Modify Ticket

Action
as closed The owner will remain stappers@….
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.