![]() Line 5: Unable to read Zaptel version information. Here is some info on the HP server cat /etc/nf The other machine is a Dell SC440 with a TDM400 card. The Server is a HP ML110 g3 with openSUSE 10.2 with TE110 installed If I compile zaptel-1.2.12 and ‘make install’ the problem does not appear. On another machine I get the same problem with a TDM 400 when I modprobe wctdm ZT_CHANCONFIG failed on channel 1: Inappropriate ioctl for device (25) This would allow you to use sudo commands in your script without having to hardcode a password.This problem occurs on more than one machine Your script, would simply need to do something like: read -p "Please enter your sudo password: " -s sudopasswdĮcho "$sudopasswd" | sudo -S x11vnc -storepasswd ~/.vnc/passwd Read -p "Please enter your sudo password: " -s sudopasswdĮcho "$sudopasswd" | sudo -S tail -1 /etc/shadowĮcho "$sudopasswd" | sudo -S ls -la /root/ Here is an example script to demonstrate the process: #!/bin/bash Tail: cannot open `/etc/shadow' for reading: Permission ~]$ echo | sudo -S tail -1 /etc/shadow Sudo has an option -S that allows it to read the passwd from STDIN. ![]() Sudo script -q /dev/null x11vnc -storepasswd ~/.vnc/passwd <<ENDDOC Sudo script -q -c 'x11vnc -storepasswd ~/.vnc/passwd' /dev/null Printf '%s\n' 'password' 'password' 'y' | Sudo script -q -c 'x11vnc -storepasswd ~/.vnc/passwd' <<ENDDOC /dev/null Solutions using the script command: # GNU script command # Write password to ~/.vnc/passwd? /n Password written to: ~/.vnc/passwd # Enter VNC password: stty: stdin isn't a terminal Sudo x11vnc -storepasswd ~/.vnc/passwd << ENDDOC The warning messages on Mac OS X 10.6.8 for not providing a pseudo-terminal for x11vnc: # x11vnc 0.9.14 This can be done with the script command or tools such as pdip ("Programmed Dialogue with Interactive Programs"). Will using expect be a better solution? If so, how would I use it in this case? (I have never used expect before but I have looked at a lot of examples since posting this question and I cannot get expect to work on my own.)Īnother option to avoid those warning messages is to execute x11vnc in a pseudo-terminal created by a UNIX command (see Using pseudo-terminals (pty) to control interactive programs). Write password to /home/user/.vnc/passwd? /n n In case it helps, the prompts look like this: I would appreciate a working example of how to implement sudo x11vnc -storepasswd ~/.vnc/passwd in a script. That obviously (from the error) does not work. My problem is related to x11vnc -storepasswd and here's my code: sudo x11vnc -storepasswd ~/.vnc/passwd << ENDDOC Please notice that this error message is from x11vnc -storepassword (not from sudo.) Stty: standard input: Inappropriate ioctl for device However, in one case I get this error: Enter VNC password: stty: standard input: Inappropriate ioctl for device In most instances the here-document approach handles this fine. I enter the password once and the script passes it to the various commands. ![]() I'm using here-documents in a bash script to automate installation and setup where a password is required many times.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |