Skip to content

Commit 654b682

Browse files
authored
Merge pull request fsantini#23 from lucarota/master
Various updates
2 parents 100a8d1 + 4b9afb2 commit 654b682

17 files changed

+422
-251
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Below we describe each step.
2121
### Compilling
2222

2323
- Move to the project directory root
24+
- Open the configuration file located at `src/usr/local/kobocloud/kobocloudrc.tmpl`
25+
- Add the links to the cloud services (see the configuration example that follow below)
2426
- Run `sh ./makeKoboRoot.sh`
2527

2628
The last command will create a `KoboRoot.tgz` archive.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KERNEL=="eth*", RUN+="/usr/local/kobocloud/udev_program.sh"
2-
KERNEL=="wlan*", RUN+="/usr/local/kobocloud/udev_program.sh"
1+
KERNEL=="eth*", ACTION=="add", RUN+="/usr/local/kobocloud/udev_program.sh"
2+
KERNEL=="wlan*", ACTION=="add", RUN+="/usr/local/kobocloud/udev_program.sh"
33
KERNEL=="lo", RUN+="/usr/local/kobocloud/udev_mount.sh"
44

src/usr/local/kobocloud/ca-bundle.crt

Lines changed: 371 additions & 219 deletions
Large diffs are not rendered by default.

src/usr/local/kobocloud/config.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/bin/bash
22

3+
KC_HOME=$(dirname $0)
4+
ConfigFile=$KC_HOME/kobocloudrc.tmpl
5+
36
if uname -a | grep -q x86
47
then
58
#echo "PC detected"
6-
. `dirname $0`/config_pc.sh
9+
. $KC_HOME/config_pc.sh
710
else
8-
. `dirname $0`/config_kobo.sh
11+
. $KC_HOME/config_kobo.sh
912
fi

src/usr/local/kobocloud/config_kobo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Lib=/mnt/onboard/.add/kobocloud/Library
44
SD=/mnt/sd/kobocloud
55
UserConfig=/mnt/onboard/.add/kobocloud/kobocloudrc
66
Dt="date +%Y-%m-%d_%H:%M:%S"
7-
CURL="`dirname $0`/curl --cacert \"`dirname $0`/ca-bundle.crt\" "
7+
CURL="$KC_HOME/curl --cacert \"$KC_HOME/ca-bundle.crt\" "
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
Logs=/tmp/KoboCloud
33
Lib=/tmp/KoboCloud/Library
4-
SD=/tmp/KoboCloud
4+
SD=/tmp/KoboCloud/sd
55
UserConfig=/tmp/KoboCloud/kobocloudrc
66
Dt="date +%Y-%m-%d_%H:%M:%S"
77
CURL=/usr/bin/curl

src/usr/local/kobocloud/get.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#Kobocloud getter
33

44
#load config
5-
. `dirname $0`/config.sh
5+
. $(dirname $0)/config.sh
66

77
#check if Kobocloud contains the line "UNINSTALL"
88
if grep -q '^UNINSTALL$' $UserConfig; then
99
echo "Uninstalling KoboCloud!"
10-
`dirname $0`/uninstall.sh
10+
$KC_HOME/uninstall.sh
1111
exit 0
1212
fi
1313

@@ -33,15 +33,15 @@ while read url; do
3333
else
3434
echo "Getting $url"
3535
if echo $url | grep -q '^https*://www.dropbox.com'; then # dropbox link?
36-
`dirname $0`/getDropboxFiles.sh "$url" "$Lib"
36+
$KC_HOME/getDropboxFiles.sh "$url" "$Lib"
3737
elif echo $url | grep -q '^https*://filedn.com'; then
38-
`dirname $0`/getpCloudFiles.sh "$url" "$Lib"
38+
$KC_HOME/getpCloudFiles.sh "$url" "$Lib"
3939
elif echo $url | grep -q '^https*://[^/]*pcloud'; then
40-
`dirname $0`/getpCloudFiles.sh "$url" "$Lib"
40+
$KC_HOME/getpCloudFiles.sh "$url" "$Lib"
4141
elif echo $url | grep -q '^https*://drive.google.com'; then
42-
`dirname $0`/getGDriveFiles.sh "$url" "$Lib"
42+
$KC_HOME/getGDriveFiles.sh "$url" "$Lib"
4343
else
44-
`dirname $0`/getOwncloudFiles.sh "$url" "$Lib"
44+
$KC_HOME/getOwncloudFiles.sh "$url" "$Lib"
4545
fi
4646
fi
4747
done < $UserConfig

src/usr/local/kobocloud/getDropboxFiles.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ baseURL="$1"
44
outDir="$2"
55

66
#load config
7-
. `dirname $0`/config.sh
7+
. $(dirname $0)/config.sh
88

99
baseURL=`echo "$baseURL" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'`
1010

@@ -25,7 +25,7 @@ do
2525
outFileName=`echo $linkLine | sed -e 's|.*/\(.*\)?dl=.*|\1|'`
2626
#echo $outFileName
2727
localFile="$outDir/$outFileName"
28-
`dirname $0`/getRemoteFile.sh "$linkLine" "$localFile"
28+
$KC_HOME/getRemoteFile.sh "$linkLine" "$localFile"
2929
if [ $? -ne 0 ] ; then
3030
echo "Having problems contacting Dropbox. Try again in a couple of minutes."
3131
exit

src/usr/local/kobocloud/getGDriveFiles.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ baseURL="$1"
44
outDir="$2"
55

66
#load config
7-
. `dirname $0`/config.sh
7+
. $(dirname $0)/config.sh
88

99
# get directory listing
1010
echo "Getting $baseURL"
@@ -26,7 +26,7 @@ do
2626
outFileName=`echo $fileName | tr ' ' '_'`
2727
localFile="$outDir/$outFileName"
2828

29-
`dirname $0`/getRemoteFile.sh "$linkLine" "$localFile"
29+
$KC_HOME/getRemoteFile.sh "$linkLine" "$localFile"
3030
if [ $? -ne 0 ] ; then
3131
echo "Having problems contacting Google Drive. Try again in a couple of minutes."
3232
exit

src/usr/local/kobocloud/getOwncloudFiles.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ baseURL="$1"
44
outDir="$2"
55

66
#load config
7-
. `dirname $0`/config.sh
7+
. $(dirname $0)/config.sh
88

99
# webdav implementation
1010
# https://myserver.com/s/shareLink
@@ -16,15 +16,15 @@ echo $shareID
1616
echo $davServer
1717

1818
# get directory listing
19-
`dirname $0`/getOwncloudList.sh $shareID $davServer |
19+
$KC_HOME/getOwncloudList.sh $shareID $davServer |
2020
while read relativeLink
2121
do
2222
# process line
2323
outFileName=`basename $relativeLink`
2424
linkLine=$davServer/$relativeLink
2525
localFile="$outDir/$outFileName"
2626
# get remote file
27-
`dirname $0`/getRemoteFile.sh "$linkLine" "$localFile" $shareID
27+
$KC_HOME/getRemoteFile.sh "$linkLine" "$localFile" $shareID
2828
if [ $? -ne 0 ] ; then
2929
echo "Having problems contacting Owncloud. Try again in a couple of minutes."
3030
exit

0 commit comments

Comments
 (0)