Skip to content

Commit

Permalink
Merge pull request #15 from geraldoramos/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
geraldoramos authored Sep 7, 2017
2 parents bb42b6b + 9382d11 commit 87dbe69
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
**v0.3-alpha**
* Various fixes and improvements
* Ability to setup a name for the camera and save files under it's name on dropbox

**v0.4-alpha**
* Fixed issue with modules being called even if not installed
2 changes: 1 addition & 1 deletion modules/dropbox/on_movie_end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#Define on_movie_end routine for this module. Path to file is available through variable $1 and name of the camera through variable $2

echo "on_movie_end routine for Dropbox"
sudo /home/pi/pigeon/modules/dropbox/binaries/dropbox_uploader.sh -f /home/pi/pigeon/modules/dropbox/binaries/dropbox.conf upload $1 /$2/ && rm -rf $1
sudo /home/pi/pigeon/modules/dropbox/binaries/dropbox_uploader.sh -f /home/pi/pigeon/modules/dropbox/binaries/dropbox.conf upload $1 /$2/ && sudo rm -rf $1
2 changes: 1 addition & 1 deletion modules/dropbox/on_picture_save.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#Define on_picture_save routine for this module. Path to file is available through variable $1 and name of the camera through variable $2

echo "on_picture_save routine for Dropbox"
sudo /home/pi/pigeon/modules/dropbox/binaries/dropbox_uploader.sh -f /home/pi/pigeon/modules/dropbox/binaries/dropbox.conf upload $1 /$2/ && rm -rf $1
sudo /home/pi/pigeon/modules/dropbox/binaries/dropbox_uploader.sh -f /home/pi/pigeon/modules/dropbox/binaries/dropbox.conf upload $1 /$2/ && sudo rm -rf $1
Empty file added modules_enabled.conf
Empty file.
21 changes: 16 additions & 5 deletions pigeon_modules_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,32 @@
echo "Starting Modules Script"

camera_name=pigeon
conf_file=/home/pi/pigeon/modules_enabled.conf

for d in modules/*/ ; do
for d in /home/pi/pigeon/modules/*/ ; do

if [[ $1 == 'install' ]]
then
echo -n "Do you want install $d ? [y/N]"
read install
if [[ $install == "y" ]] || [[ $install == "Y" ]] || [[ $intall == "Yes" ]] || [[ $install == "yes" ]]
then
sudo chmod +x '/home/pi/pigeon/'$d$1'.sh'
sudo '/home/pi/pigeon/'$d$1'.sh'
sudo chmod +x $d$1'.sh'
sudo $d$1'.sh'
echo $d >> $conf_file
fi
elif [[ $1 == "on_movie_end" ]] || [[ $1 == "on_picture_save" ]]
then
if grep -Fxq "$d" $conf_file
then
sudo chmod +x $d$1'.sh'
sudo $d$1'.sh' $2 $camera_name
echo "Finished $1 routine for $d"
fi
else
sudo chmod +x '/home/pi/pigeon/'$d$1'.sh'
sudo '/home/pi/pigeon/'$d$1'.sh' $2 $camera_name
echo "$1 is not a recognized command"
fi

done

echo "Ended Modules Script"

0 comments on commit 87dbe69

Please sign in to comment.