Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Rudolph
lede-mikrotik
Commits
b54144a4
Commit
b54144a4
authored
10 years ago
by
Felix Fietkau
Browse files
Options
Downloads
Patches
Plain Diff
uqmi: replace logger calls in netifd with echo
Signed-off-by:
Felix Fietkau
<
nbd@openwrt.org
>
SVN-Revision: 42720
parent
cf595fe8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+12
-12
12 additions, 12 deletions
package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
with
12 additions
and
12 deletions
package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+
12
−
12
View file @
b54144a4
...
@@ -24,13 +24,13 @@ proto_qmi_setup() {
...
@@ -24,13 +24,13 @@ proto_qmi_setup() {
json_get_vars device apn auth username password pincode delay modes
json_get_vars device apn auth username password pincode delay modes
[
-n
"
$device
"
]
||
{
[
-n
"
$device
"
]
||
{
logger
-p
daemon.err
-t
"qmi[
$$
]"
"No control device specified"
echo
"No control device specified"
proto_notify_error
"
$interface
"
NO_DEVICE
proto_notify_error
"
$interface
"
NO_DEVICE
proto_block_restart
"
$interface
"
proto_block_restart
"
$interface
"
return
1
return
1
}
}
[
-c
"
$device
"
]
||
{
[
-c
"
$device
"
]
||
{
logger
-p
daemon.err
-t
"qmi[
$$
]"
"The specified control device does not exist"
echo
"The specified control device does not exist"
proto_notify_error
"
$interface
"
NO_DEVICE
proto_notify_error
"
$interface
"
NO_DEVICE
proto_block_restart
"
$interface
"
proto_block_restart
"
$interface
"
return
1
return
1
...
@@ -40,7 +40,7 @@ proto_qmi_setup() {
...
@@ -40,7 +40,7 @@ proto_qmi_setup() {
devpath
=
"
$(
readlink
-f
/sys/class/usbmisc/
$devname
/device/
)
"
devpath
=
"
$(
readlink
-f
/sys/class/usbmisc/
$devname
/device/
)
"
ifname
=
"
$(
ls
"
$devpath
"
/net
)
"
ifname
=
"
$(
ls
"
$devpath
"
/net
)
"
[
-n
"
$ifname
"
]
||
{
[
-n
"
$ifname
"
]
||
{
logger
-p
daemon.err
-t
"qmi[
$$
]"
"The interface could not be found."
echo
"The interface could not be found."
proto_notify_error
"
$interface
"
NO_IFACE
proto_notify_error
"
$interface
"
NO_IFACE
proto_block_restart
"
$interface
"
proto_block_restart
"
$interface
"
return
1
return
1
...
@@ -54,7 +54,7 @@ proto_qmi_setup() {
...
@@ -54,7 +54,7 @@ proto_qmi_setup() {
[
-n
"
$pincode
"
]
&&
{
[
-n
"
$pincode
"
]
&&
{
uqmi
-s
-d
"
$device
"
--verify-pin1
"
$pincode
"
||
{
uqmi
-s
-d
"
$device
"
--verify-pin1
"
$pincode
"
||
{
logger
-p
daemon.err
-t
"qmi[
$$
]"
"Unable to verify PIN"
echo
"Unable to verify PIN"
proto_notify_error
"
$interface
"
PIN_FAILED
proto_notify_error
"
$interface
"
PIN_FAILED
proto_block_restart
"
$interface
"
proto_block_restart
"
$interface
"
return
1
return
1
...
@@ -62,23 +62,23 @@ proto_qmi_setup() {
...
@@ -62,23 +62,23 @@ proto_qmi_setup() {
}
}
[
-n
"
$apn
"
]
||
{
[
-n
"
$apn
"
]
||
{
logger
-p
daemon.err
-t
"qmi[
$$
]"
"No APN specified"
echo
"No APN specified"
proto_notify_error
"
$interface
"
NO_APN
proto_notify_error
"
$interface
"
NO_APN
proto_block_restart
"
$interface
"
proto_block_restart
"
$interface
"
return
1
return
1
}
}
logger
-p
daemon.info
-t
"qmi[
$$
]"
"Waiting for network registration"
echo
"Waiting for network registration"
while
uqmi
-s
-d
"
$device
"
--get-serving-system
|
grep
'"searching"'
>
/dev/null
;
do
while
uqmi
-s
-d
"
$device
"
--get-serving-system
|
grep
'"searching"'
>
/dev/null
;
do
sleep
5
;
sleep
5
;
done
done
[
-n
"
$modes
"
]
&&
uqmi
-s
-d
"
$device
"
--set-network-modes
"
$modes
"
[
-n
"
$modes
"
]
&&
uqmi
-s
-d
"
$device
"
--set-network-modes
"
$modes
"
logger
-p
daemon.info
-t
"qmi[
$$
]"
"Starting network
$apn
"
echo
"Starting network
$apn
"
cid
=
`
uqmi
-s
-d
"
$device
"
--get-client-id
wds
`
cid
=
`
uqmi
-s
-d
"
$device
"
--get-client-id
wds
`
[
$?
-ne
0
]
&&
{
[
$?
-ne
0
]
&&
{
logger
-p
daemon.err
-t
"qmi[
$$
]"
"Unable to obtain client ID"
echo
"Unable to obtain client ID"
proto_notify_error
"
$interface
"
NO_CID
proto_notify_error
"
$interface
"
NO_CID
proto_block_restart
"
$interface
"
proto_block_restart
"
$interface
"
return
1
return
1
...
@@ -90,7 +90,7 @@ proto_qmi_setup() {
...
@@ -90,7 +90,7 @@ proto_qmi_setup() {
${
username
:+--username
$username
}
\
${
username
:+--username
$username
}
\
${
password
:+--password
$password
}
`
${
password
:+--password
$password
}
`
[
$?
-ne
0
]
&&
{
[
$?
-ne
0
]
&&
{
logger
-p
daemon.err
-t
"qmi[
$$
]"
"Unable to connect, check APN and authentication"
echo
"Unable to connect, check APN and authentication"
proto_notify_error
"
$interface
"
NO_PDH
proto_notify_error
"
$interface
"
NO_PDH
proto_block_restart
"
$interface
"
proto_block_restart
"
$interface
"
return
1
return
1
...
@@ -98,13 +98,13 @@ proto_qmi_setup() {
...
@@ -98,13 +98,13 @@ proto_qmi_setup() {
uci_set_state network
$interface
pdh
"
$pdh
"
uci_set_state network
$interface
pdh
"
$pdh
"
if
!
uqmi
-s
-d
"
$device
"
--get-data-status
|
grep
'"connected"'
>
/dev/null
;
then
if
!
uqmi
-s
-d
"
$device
"
--get-data-status
|
grep
'"connected"'
>
/dev/null
;
then
logger
-p
daemon.err
-t
"qmi[
$$
]"
"Connection lost"
echo
"Connection lost"
proto_notify_error
"
$interface
"
NOT_CONNECTED
proto_notify_error
"
$interface
"
NOT_CONNECTED
proto_block_restart
"
$interface
"
proto_block_restart
"
$interface
"
return
1
return
1
fi
fi
logger
-p
daemon.info
-t
"qmi[
$$
]"
"Connected, starting DHCP"
echo
"Connected, starting DHCP"
proto_init_update
"
$ifname
"
1
proto_init_update
"
$ifname
"
1
proto_send_update
"
$interface
"
proto_send_update
"
$interface
"
...
@@ -131,7 +131,7 @@ proto_qmi_teardown() {
...
@@ -131,7 +131,7 @@ proto_qmi_teardown() {
local
cid
=
$(
uci_get_state network
$interface
cid
)
local
cid
=
$(
uci_get_state network
$interface
cid
)
local
pdh
=
$(
uci_get_state network
$interface
pdh
)
local
pdh
=
$(
uci_get_state network
$interface
pdh
)
logger
-p
daemon.info
-t
"qmi[
$$
]"
"Stopping network"
echo
"Stopping network"
[
-n
"
$cid
"
]
&&
{
[
-n
"
$cid
"
]
&&
{
[
-n
"
$pdh
"
]
&&
{
[
-n
"
$pdh
"
]
&&
{
uqmi
-s
-d
"
$device
"
--set-client-id
wds,
"
$cid
"
--stop-network
"
$pdh
"
uqmi
-s
-d
"
$device
"
--set-client-id
wds,
"
$cid
"
--stop-network
"
$pdh
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment