Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PULT
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Gerwinski
PULT
Commits
aa1f2c5b
Commit
aa1f2c5b
authored
Dec 15, 2020
by
Peter Gerwinski
Browse files
Options
Downloads
Patches
Plain Diff
trying to make upload.daemon more robust
parent
c7bc27c4
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/pult/pult.daemon
+1
-1
1 addition, 1 deletion
lib/pult/pult.daemon
lib/pult/upload.daemon
+2
-4
2 additions, 4 deletions
lib/pult/upload.daemon
lib/pult/upload.module
+4
-4
4 additions, 4 deletions
lib/pult/upload.module
with
7 additions
and
9 deletions
lib/pult/pult.daemon
+
1
−
1
View file @
aa1f2c5b
...
...
@@ -240,7 +240,7 @@ background_wid=$(xwininfo -root -children | grep "$background_pattern" | awk '{
xdotool set_window
--name
"Controlled by PULT"
"
$background_wid
"
while
true
;
do
nc.openbsd
-q
0
-w
10
-l
"
$pultd_port
"
|
\
nc.openbsd
-q
0
-l
"
$pultd_port
"
|
\
while
read
-ra
cmd
;
do
m
=
"
${
cmd
[0]
}
"
$debug
&&
echo
-e
"
$0
: command =
\"
${
cmd
[*]
}
\"
"
1>&2
...
...
This diff is collapsed.
Click to expand it.
lib/pult/upload.daemon
+
2
−
4
View file @
aa1f2c5b
...
...
@@ -22,6 +22,7 @@ pointer_windowid=""
cleanup
()
{
rm
-rf
"
$b64_filename
"
"
$lock_filename
"
if
[
-n
"
$(
jobs
-p
)
"
]
;
then
kill
$(
jobs
-p
)
fi
...
...
@@ -31,8 +32,7 @@ trap cleanup exit;
shopt
-s
lastpipe
while
true
;
do
nc.openbsd
-w
10
-l
"
$module_daemon_port
"
|
\
nc.openbsd
-l
"
$module_daemon_port
"
|
\
while
read
cmd param_x param_y
;
do
echo
"cmd =
$cmd
, param_x =
$param_x
, param_y =
$param_y
"
if
[
"
$cmd
"
=
"pointer"
]
;
then
...
...
@@ -73,5 +73,3 @@ while true; do
echo
"... done."
fi
done
sleep
1s
done
This diff is collapsed.
Click to expand it.
lib/pult/upload.module
+
4
−
4
View file @
aa1f2c5b
...
...
@@ -31,7 +31,7 @@ img_title="$module_name Image Viewer"
cmd
=
"$1"
case
"
$cmd
"
in
start
)
rm
-
rf
"
$pid_file
"
"
$config_file
"
"
$upload_dir
/
$filename
"
"
$upload_dir
/
$error_filename
"
"
$www_dir$download_dir
/
$filename
"
rm
-
rf
"
$pid_file
"
"
$config_file
"
"
$upload_dir
/
$filename
"
"
$upload_dir
/
$error_filename
"
"
$upload_dir
/
$lock_filename
"
"
$www_dir$download_dir
/
$filename
"
touch
"
$config_file
"
echo
-
e
"
\$
pultd_port =
$pultd_port
;"
>>
"
$config_file
"
echo
-
e
"
\$
module_name =
\"
$module_name
\"
;"
>>
"
$config_file
"
...
...
@@ -49,12 +49,12 @@ case "$cmd" in
sleep
1
echo
-
e
"$0[
$channel
]: ... okay, let's hope."
fi
echo
websockify
"
$module_daemon_port
"
--
"
$daemon
"
"
$module_name
"
"
$channel
"
\
echo
websockify
"
$module_daemon_port
"
--
wrap
-
mode
=
respawn
--
"
$daemon
"
"
$module_name
"
"
$channel
"
\
"
$module_daemon_port
"
"
$img_title
"
\
"
$www_dir
/
$pointer_filename
"
\
"
$upload_dir
/
$b64_filename
"
"
$upload_dir
/
$lock_filename
"
\
"
$upload_dir
/
$filename
"
websockify
"
$module_daemon_port
"
--
"
$daemon
"
"
$module_name
"
"
$channel
"
\
websockify
"
$module_daemon_port
"
--
wrap
-
mode
=
respawn
--
"
$daemon
"
"
$module_name
"
"
$channel
"
\
"
$module_daemon_port
"
"
$img_title
"
\
"
$www_dir
/
$pointer_filename
"
\
"
$upload_dir
/
$b64_filename
"
"
$upload_dir
/
$lock_filename
"
\
...
...
@@ -77,7 +77,7 @@ case "$cmd" in
else
echo
-
e
"$0[
$channel
]: stop: not running"
fi
rm
-
rf
"
$upload_dir
/
$filename
"
"
$upload_dir
/
$error_filename
"
"
$www_dir$download_dir
/
$filename
"
rm
-
rf
"
$pid_file
"
"
$config_file
"
"
$upload_dir
/
$filename
"
"
$upload_dir
/
$error_filename
"
"
$upload_dir
/
$lock_filename
"
"
$www_dir$download_dir
/
$filename
"
;;
defaults
)
echo
"min=false"
...
...
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