Skip to content
Snippets Groups Projects
Commit e88753d3 authored by Bob Mottram's avatar Bob Mottram
Browse files

Add some subdirectories to the mesh public desktop folder

parent 4f512f52
No related branches found
No related tags found
No related merge requests found
......@@ -680,7 +680,9 @@ function setup_ipfs {
TOX_ID='none'
if [ -d /home/$MY_USERNAME/Desktop ]; then
if [ ! -d /home/$MY_USERNAME/Public ]; then
mkdir /home/$MY_USERNAME/Public
mkdir -p /home/$MY_USERNAME/Public/Videos
mkdir -p /home/$MY_USERNAME/Public/Music
mkdir -p /home/$MY_USERNAME/Public/Documents
echo $'Files within this directory will be publicly visible on the network' > /home/$MY_USERNAME/Public/README.txt
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Public
ln -s /home/$MY_USERNAME/Public /home/$MY_USERNAME/Desktop/Public
......
......@@ -68,6 +68,25 @@ function ipfs_publish {
NEW_STAT=$(stat -t $DIR_TO_CHECK)
# include some subdirectories
for dir in $DIR_TO_CHECK/*/
do
REALLY_NEW_STAT="$NEW_STAT$(stat -t $dir)"
NEW_STAT="$REALLY_NEW_STAT"
for dir2 in "$dir"/*/
do
REALLY_NEW_STAT="$NEW_STAT$(stat -t $dir2)"
NEW_STAT="$REALLY_NEW_STAT"
for dir3 in "$dir2"/*/
do
REALLY_NEW_STAT="$NEW_STAT$(stat -t $dir3)"
NEW_STAT="$REALLY_NEW_STAT"
done
done
done
if [ "$OLD_STAT" != "$NEW_STAT" ]; then
su -c "echo \$($IPFS_COMMAND add -rq /home/$MY_USERNAME/Public | tail -n 1) > $IPFS_PUBLIC" - $MY_USERNAME
echo "$NEW_STAT" > $OLD_STAT_FILE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment