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.
cd
cd directoryA
cd /home/pi/directoryA
pwd
The command displays the name of the present working directory: on a Raspberry Pi, entering will output something like .
pwd
pwd
/home/pi
mkdir
You can use to create a new directory, eg would create the directory in the present working directory.
mkdir
mkdir newDir
newDir
rmdir
To remove empty directories, use . So, for example, will remove the directory only if it is empty.
rmdir
rmdir oldDir
oldDir
rm
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
-r
cp
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.
cp
cp ~/fileA /home/otherUser/
fileA
otherUser
FILE FILE
cp fileA fileB
FILE DIR
cp fileA /directoryB/
-r DIR DIR
mv
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.
mv
cp
mv
cp
mv ~/fileA /home/otherUser/
fileA
FILE FILE
mv fileA fileB
FILE DIR
mv fileA /directoryB/
DIR DIR
mv /directoryB /directoryC
touch
The command sets the last modified time-stamp of the specified file (s) or creates it if it does not already exist.
touch
cat
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.
cat
cat thisFile
thisFile
cat *.txt
.txt
head
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
-c
tail
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.
head
tail
-b
-c
-n
chmod
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.
chmod
chmod
u
g
o
r
w
x
chmod 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.
chown
sudo chown pi:root *filename*
ssh
ssh
denotes 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)
scp
ssh
sudo
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
sudo
sudo -s
dd
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.
dd
dd if=/dev/sdd of=backup.img
df
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.
df
df -h
unzip
The command extracts the files from a compressed zip file.
unzip
tar
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.
tar
To 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
|
ls
ls | head
tree
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
wget
wget https://www.raspberrypi.org/documentation/linux/usage/commands.md
commands.md
curl
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.
curl
you
Show the manual page for a file. To find out more, run to view the manual page of the man command.
man
man man
Search
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.
grep
grep "search" *.txt
The command supports regular expressions which allows special letter combinations to be included in the search.
grep
awk
awk
is a programming language useful for searching and manipulating text files.place
The command searches a directory and subdirectories for files matching certain patterns.
find
whereis
Use to find the location of a command. It looks through standard program locations until it finds the requested command.
whereis
Networking
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.
ping
ping raspberrypi.org
ping 8.8.8.8
-c
nmap
nmap
is 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.nmap
hostname
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 ).
hostname
hostname new-host
ifconfig
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.
ifconfig
ifconfig
eth0
lo
I hope this infromation helps!
Regards,
Lewis
Tech-consultant
Apps4rent