Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:17:35+00:00 2026-06-14T07:17:35+00:00

I am trying to write an ASH script to run on my OpenWRT router.

  • 0

I am trying to write an ASH script to run on my OpenWRT router.

I have installed onto it nodogsplash, which displays a login page when you first try to authenticate with the router.

nodogsplash comes with a command line utility which allows you to change the password:

ndsctl password newpassword

So I am trying to write a script which I can setup as a cron job to run once a day to change the password to something new, however I am struggling to get it to output correctly. My script atm:

#!/bin/ash
local randompassLength
local pass
randompassLength=8
pass=</dev/urandom tr -dc A-Za-z0-9 | head -c $randompassLength
ndsctl password "$pass"

When I run this I get the output:

miqM2Ah6Password set to .

Which seems to chuck the password at the start of the echo and set the password to blank.

Any ideas what I am doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:17:38+00:00Added an answer on June 14, 2026 at 7:17 am

    You’re missing command substitution:

    pass=$(</dev/urandom tr -dc A-Za-z0-9 | head -c $randompassLength)
    

    or using backquotes:

    pass=`</dev/urandom tr -dc A-Za-z0-9 | head -c $randompassLength`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying write a query to find records which don't have a matching record
Trying to write a contact form script only my following page isnt processing... <?php
I am trying write a script where when a user clicks on a link,
I've had problem when trying write a function which has a default value when
Im trying to write an upload script that only accepts PNG images on upload.
I'm trying write a simple perl script that reads some fields from a password
trying to write a functional php script to detect charset retrieve web pages. My
Trying to write a trivial application, But I have stuck into one of the
Trying to write a byte[] to a file, which i think is working correctly
I've been trying write an application which will be able to connect to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.