Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
camera-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ThiefSil
camera-node
Commits
954fa42b
Commit
954fa42b
authored
4 months ago
by
한동현
Browse files
Options
Downloads
Patches
Plain Diff
chore: recovery shell script 수정
parent
d61f0106
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
recovery.sh
+22
-18
22 additions, 18 deletions
recovery.sh
with
22 additions
and
18 deletions
recovery.sh
+
22
−
18
View file @
954fa42b
#!bin/bash
FILE_NAM
E
=
"camera"
SERVICE_FILE
=
"/etc/systemd/system/
${
FILE_NAME
}
.service"
FILE
_NAME2
=
"ocr"
SERVICE_FILE2
=
"/etc/systemd/system/
${
FILE_NAME2
}
.service"
CAMERA_FIL
E
=
"camera"
SERVICE_FILE
=
"/etc/systemd/system/
camera
.service"
OCR_
FILE
=
"ocr
.py
"
SERVICE_FILE2
=
"/etc/systemd/system/
ocr
.service"
USER_NAME
=
"pi"
EXEC
_PATH
=
"
.
/camera-node-control
/
${
FILE_NAME
}
.cpp
"
EXEC
_PATH
2
=
"
.
/camera-node-ocr
/
${
FILE_NAME2
}
.py
"
CAMERA
_PATH
=
"
$(
pwd
)
/camera-node-control"
OCR
_PATH
=
"
$(
pwd
)
/camera-node-ocr"
cat
<<
EOF
| sudo tee
$SERVICE_FILE
> /dev/null
[Unit]
Description=Camera
A
t
fer=network.target
Af
t
er=network.target
[Service]
ExecStart=
$EXEC_PATH
WorkingDirectory=
$CAMERA_PATH
ExecStart=
$CAMERA_PATH
/
$CAMERA_FILE
Restart=always
RestartSec=5s
User=
$USER_NAME
[Install]
WantedBy=multi-user.target
rpi
WantedBy=multi-user.target
EOF
sudo
systemctl daemon-reload
sudo
systemctl
enable
${
FILE_NAME
}
.service
sudo
systemctl start
${
FILE_NAME
}
.service
sudo
systemctl status
${
FILE_NAME
}
.service
sudo
systemctl
enable
camera
.service
sudo
systemctl start
camera
.service
sudo
systemctl status
camera
.service
cat
<<
EOF
| sudo tee
$SERVICE_FILE2
> /dev/null
[Unit]
Description=Ocr
A
t
fer=network.target
Af
t
er=network.target
[Service]
ExecStart=python3
$EXEC_PATH2
WorkingDirectory=
$OCR_PATH
ExecStart=/bin/bash -c "source
$OCR_PATH
/venv/bin/activate && python3
$OCR_PATH
/
$OCR_FILE
"
Restart=always
RestartSec=5s
User=
$USER_NAME
[Install]
WantedBy=multi-user.target
rpi
WantedBy=multi-user.target
EOF
sudo
systemctl daemon-reload
sudo
systemctl
enable
${
FILE_NAME2
}
.service
sudo
systemctl start
${
FILE_NAME2
}
.service
sudo
systemctl status
${
FILE_NAME2
}
.service
sudo
systemctl
enable
ocr
.service
sudo
systemctl start
ocr
.service
sudo
systemctl status
ocr
.service
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment