Skip to content

Commit

Permalink
Several fixes (#38)
Browse files Browse the repository at this point in the history
- GNU/Linux: fixed `install.sh`
- GNU/Linux: fixed `uninstall.sh`
- GNU/Linux: add more examples for `streamer`
- Fixed the GPG file creation!
  • Loading branch information
Christophe SEGUINOT authored May 20, 2020
1 parent 1e15dee commit d4adb06
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
23 changes: 14 additions & 9 deletions gnu-linux/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/sh
#
# Installation script for Pombo.
#
Expand All @@ -11,15 +11,19 @@ fi
inst_dir=/usr/local/bin
[ -d ${inst_dir} ] || inst_dir=/usr/local/sbin

src_dir=""
[ -f pombo.py ] || src_dir="../"
script=$(readlink -f "$0")
# Absolute path install.sh script is in
src_dir=$(dirname "$script")
# Absolute path of Pombo main dir (without trailing /)
src_dir=$(dirname "$src_dir")


echo "\nInstalling (verbose) ..."
[ -f /etc/pombo.conf ] && mv -fv /etc/pombo.conf /etc/pombo.conf.$(date '+%s')
install -v ${src_dir}pombo.conf /etc
install -v ${src_dir}/pombo.conf /etc
echo "« chmod 600 /etc/pombo.conf »"
chmod 600 /etc/pombo.conf
install -v ${src_dir}pombo.py ${inst_dir}/pombo
install -v ${src_dir}/pombo.py ${inst_dir}/pombo
echo "« chmod +x ${inst_dir}/pombo »"
chmod +x ${inst_dir}/pombo

Expand All @@ -43,12 +47,13 @@ echo "Done."

echo "\nChecking dependancies ..."
ok=1
for package in python gpg ifconfig iwlist traceroute streamer; do

for package in python gpg ifconfig iwlist traceroute streamer; do
test=$(which ${package})
[ $? != 0 ] && echo " ! ${package} needed but not installed." && ok=0
[ $? != 0 ] && echo " ! ${test}.... ${package} needed but not installed." && ok=0
done
python check-imports.py
[ $? != 0 ] && ok=0
echo "Shell script uses Python $(python --version)"
python ${src_dir}/tools/check-imports.py
case ${ok} in
1) echo "Done." ;;
*) echo "Please install necessary tools before continuing." ;;
Expand Down
2 changes: 1 addition & 1 deletion gnu-linux/uninstall.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/sh
#
# Uninstallation script for Pombo.
#
Expand Down
2 changes: 2 additions & 0 deletions pombo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ screenshot=yes
; Take webcam shot?
; <filepath> will be replaced by a filename, do not customize (required).
; [W] yes or no
; [L] /usr/bin/streamer -q -t 1 -r 2 -o <filepath>
; [L] /usr/bin/streamer -q -t 1 -r 2 -j 100 -s 640x480 -o <filepath>
; [L] /usr/bin/streamer -q -w 3 -o <filepath>
; [L] /usr/bin/streamer -q -j 100 -w 3 -s 640x480 -o <filepath>
; [L] /usr/bin/gst-launch -q v4l2src num_buffers=1 decimate=70 ! pngenc ! filesink location=<filepath>
Expand Down
4 changes: 2 additions & 2 deletions pombo.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,9 @@ def snapshot(self, current_ip):
"-r",
self.configuration["gpgkeyid"],
"-o",
output,
"-e",
output + ".gpg",
"-e",
output,
]
)

Expand Down

0 comments on commit d4adb06

Please sign in to comment.