Raspberry PI 4 extcommands
Hallo ich habe folgendes Problem, Ich habe heute meinen PI4 mal ausgepackt und wollte ihn in betrieb nehmen. also Repetier Server sauber installiert. und meine Scripte an den neuen PI angepasst. Läuft auch alles nur ich kann über den Repetier Server keine befehle ausführen nicht mal der Reboot funktioniert von RP... Also brauch ich mal euer wissen ich habe auch schon mit der Version 90.7 und auch mit der neuen 93.1 es geht bei keiner Version.
Liebe grüße jan
Liebe grüße jan
Comments
Merkwürdig ist nur das shutdown/reboot auch nicht funktionieren sollen. Die sind ja in unserem image in extcommands.xml bereits korrekt vorkonfiguriert und auch in sudoers.d eingetragen root rechte zu bekommen (könnte bei eigenen skripten auch ein problem sein wenn die root rechte brauchen).
Ich habe allen Datei den Benutzer Repetierserver zugewiesen. und er hat auch auszuführende rechte.
Von was für Befehlen reden wir hier? @execute oder oder in den Menüs?
Wenn extcommands.xml einen Syntaxfehler enthält würden sie nicht geladen werden und nicht funktionieren. Die Befehle in den Menüs würden dann aber auch nicht angezeigt werden.
Es sind einfache sudo /home/pi/druckeran.sh befehle also keine hohe Kunst.
Auch eine Neu installation bringt keine erfolg er schreibt den nicht mal eine neue Datei wenn ich alles lösche. Und auch wie gesagt der reboot geht auch nicht.
für meine Verhältnisse sieht das auch okay aus ?
sudo /home/pi/druckeran.sh
heist aber nicht das der Befehl als repetierserver ausgeführt wird. Er wird als root ausgeführt aber das klappt nur wenn /home/pi/druckeran.sh in der sudoers liste eingetragen ist. Sonst kommt eine Passwortnachfrage die du nicht beantworten kannst weil das ja im Hintergrund passiert.
Hats du jetzt das original image installiert und da wurde die Original-Liste bereits nicht geladen so das kein reboot/shutdown vorhanden war?
was mich zwar wieder vor ein Problem stellt wie soll ich mein Script da eintragen
Das ist meine Printer1.sh :
und diese liegt in /home/pi/printer1.sh kannst du mir da einen befehl sagen wie ich diese zum laufen bekommen ich habe es schon versucht aber er bekommt einfach keine Root rechte.
https://www.repetier-server.com/download-images/
runtergeladen hast. Scheint eher als ob es das original image war womit klar ist warum shutdown/reboot auch nicht funktionieren. Im manual steht aber wie man es einträgt:
Für dein script wäre das dann noch
File system
ls
The command lists the content of the current directory (or one that is specified). It can be used with the flag to display additional information (permissions, owner, group, size, date and timestamp of last edit) about each file and directory in a list format. The flag allows you to view files beginning with (ie dotfiles).
ls-l-a.CD
Using changes the current directory to the one specified. You can use relative (ie ) or absolute (ie ) paths.
cdcd directoryAcd /home/pi/directoryApwd
The command displays the name of the present working directory: on a Raspberry Pi, entering will output something like .
pwdpwd/home/pimkdir
You can use to create a new directory, eg would create the directory in the present working directory.
mkdirmkdir newDirnewDirrmdir
To remove empty directories, use . So, for example, will remove the directory only if it is empty.
rmdirrmdir oldDiroldDirrm
The command removes the specified file (or recursively from a directory when used with ). Be careful with this command: files deleted in this way are mostly gone for good!
rm-rcp
Using makes a copy of a file and places it at the specified location (this is similar to copying and pasting). For example, would copy the file from your home directory to that of the user (assuming you have permission to copy it there). This command can either take ( ), ( ) or (which recursively copies the contents of directories) as arguments.
cpcp ~/fileA /home/otherUser/fileAotherUserFILE FILEcp fileA fileBFILE DIRcp fileA /directoryB/-r DIR DIRmv
The command moves a file and places it at the specified location (so where performs a 'copy-paste', performs a 'cut-paste'). The usage is similar to . So would move the file from your home directory to that of the user otherUser. This command can either take ( ), ( ) or ( ) as arguments. This command is also useful as a method to rename files and directories after they've been created.
mvcpmvcpmv ~/fileA /home/otherUser/fileAFILE FILEmv fileA fileBFILE DIRmv fileA /directoryB/DIR DIRmv /directoryB /directoryCtouch
The command sets the last modified time-stamp of the specified file (s) or creates it if it does not already exist.
touchcat
You can use to list the contents of the file (s), eg will display the contents of. It can be used to list the contents of multiple files, ie will list the contents of all files in the current directory.
catcat thisFilethisFilecat *.txt.txthead
The command displays the beginning of a file. It can be used to specify the number of lines to show (by default ten), or to specify the number of bytes.
head-n-ctail
The opposite of, displays the end of a file. The starting point in the file can be specified either through for 512-byte blocks, for bytes, or for a number of lines.
headtail-b-c-nchmod
You would normally use to change the permissions for a file. The command can use symbols (a user that owns the file), (the file's group), and (other users) and the permissions (read), (write), and (execute). Using will add execute permission for the owner of the file.
chmodchmodugorwxchmod u+x *filename*chown
The command changes the user and / or group that owns a file. It normally needs to be run as root using sudo eg will change the owner to pi and the group to root.
chownsudo chown pi:root *filename*ssh
sshdenotes the secure shell. Connect to another computer using an encrypted network connection. For more details see SSH (secure shell)SCP
The command copies a file from one computer to another user. For more details see SCP (secure copy)
scpsshsudo
The command enables you to run a command as a superuser, or another user. Use for a superuser shell. For more details see Root user / sudo
sudosudo -sdd
The command copies a file converting the file as specified. It is often used to copy an entire disk to a single file or back again. So, for example, it will create a backup image from an SD card or USB disk drive at / dev / sdd. Make sure to use the correct drive when copying an image to the SD card as it can overwrite the entire disk.
dddd if=/dev/sdd of=backup.imgdf
Use to display the disk space available and used on the mounted filesystems. Use to see the output in a human-readable format using M for MBs rather than showing the number of bytes.
dfdf -hunzip
The command extracts the files from a compressed zip file.
unziptar
Use to store or extract files from a tape archive file. It can also reduce the space required by compressing the file similar to a zip file.
tarTo create a compressed file, use To extract the contents of a file, use
tar -cvzf *filename.tar.gz* *directory/*tar -xvzf *filename.tar.gz*pipes
A pipe allows the output from one command to be used as the input for another command. The pipe symbol is a vertical line . For example, to only show the first ten entries of the command it can be piped through the head command
|lsls | headtree
Use the command to show a directory and all subdirectories and files indented as a tree structure.
tree&
Run a command in the background, freeing up the shell for future commands.
&wget
Download a file from the web directly to the computer. So will download this file to your computer as
wgetwget https://www.raspberrypi.org/documentation/linux/usage/commands.mdcommands.mdcurl
Use to download or upload a file to/from a server. By default, it will output the file contents of the file to the screen.
curlyou
Show the manual page for a file. To find out more, run to view the manual page of the man command.
manman manSearch
grep
Use to search inside files for certain search patterns. For example, will look in all the files in the current directory ending with .txt for the string search.
grepgrep "search" *.txtThe command supports regular expressions which allows special letter combinations to be included in the search.
grepawk
awkis a programming language useful for searching and manipulating text files.place
The command searches a directory and subdirectories for files matching certain patterns.
findwhereis
Use to find the location of a command. It looks through standard program locations until it finds the requested command.
whereisNetworking
ping
The utility is usually used to check if communication can be made with another host. It can be used with default settings by just specifying a hostname (eg ) or an IP address (eg ). It can specify the number of packets to send with the flag.
pingping raspberrypi.orgping 8.8.8.8-cnmap
nmapis a network exploration and scanning tool. It can return port and OS information about a host or a range of hosts. Running just will display the options available as well as example usage.nmaphostname
The command displays the current hostname of the system. A privileged (super) user can set the hostname to a new one by supplying it as an argument (eg ).
hostnamehostname new-hostifconfig
Use to display the network configuration details for the interfaces on the current system when running without any arguments (ie ). By supplying the command with the name of an interface (eg or ) you can then alter the configuration: check the manual page for more details.
ifconfigifconfigeth0loI hope this infromation helps!Regards,LewisTech-consultantApps4rent