質問編集履歴

1

rc.localを追加しました。

2020/01/26 23:56

投稿

raspypy
raspypy

スコア247

test CHANGED
File without changes
test CHANGED
@@ -49,3 +49,55 @@
49
49
  GPIO.cleanup()
50
50
 
51
51
  ```
52
+
53
+
54
+
55
+ ##rc.local
56
+
57
+ ```text
58
+
59
+ #!/bin/sh -e
60
+
61
+ #
62
+
63
+ # rc.local
64
+
65
+ #
66
+
67
+ # This script is executed at the end of each multiuser runlevel.
68
+
69
+ # Make sure that the script will "exit 0" on success or any other
70
+
71
+ # value on error.
72
+
73
+ #
74
+
75
+ # In order to enable or disable this script just change the execution
76
+
77
+ # bits.
78
+
79
+ #
80
+
81
+ # By default this script does nothing.
82
+
83
+
84
+
85
+ # Print the IP address
86
+
87
+ _IP=$(hostname -I) || true
88
+
89
+ if [ "$_IP" ]; then
90
+
91
+ printf "My IP address is %s\n" "$_IP"
92
+
93
+ fi
94
+
95
+
96
+
97
+ python /home/pi/dev/test.py &
98
+
99
+
100
+
101
+ exit 0
102
+
103
+ ```