Add some subdirectories to the mesh public desktop folder

This commit is contained in:
Bob Mottram 2017-12-03 17:27:28 +00:00
parent 4f512f5273
commit e88753d38b
2 changed files with 22 additions and 1 deletions

View File

@ -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

View File

@ -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