Skip to content

Instantly share code, notes, and snippets.

@seth10
Last active June 27, 2017 20:06
Show Gist options
  • Save seth10/e41a091ef56d0044474e82f3541755e4 to your computer and use it in GitHub Desktop.
Save seth10/e41a091ef56d0044474e82f3541755e4 to your computer and use it in GitHub Desktop.
A script to link files in /home/pi/PiStorms to their corresponding locations in the system
b=`grep homefolder /usr/local/mindsensors/conf/msdev.cfg | cut -d"=" -f2 | cut -c 2-`
for f in 'MSDriver.py' 'MSBrowser.py' 'psm_shutdown' 'swarmserver' 'pistorms-diag.sh'; do sudo ln -f $b/sys/$f /usr/local/bin/$f; done
chmod +x $b/sys/swarmserver $b/sys/pistorms-diag.sh $b/programs/addresschange
for f in 'rmap.py' 'rmapcfg.py' 'scratch.py' 'PiStorms.py' 'PiStormsCom.py' 'TouchScreenInput.py' 'mindsensorsUI.py' 'MS_ILI9341.py' 'mindsensors.py' 'MsDevices.py' 'LegoDevices.py' 'swarmclient.py'; do sudo ln -f $b/sys/$f /usr/local/lib/python2.7/dist-packages/$f; done
sudo rm -rf /var/www
sudo ln -s $b/www /var/www
sudo ln -f $b/sys/msdev.cfg /usr/local/mindsensors/conf/msdev.cfg
# skipping images, art, scratch, changing ownerships... programs are still only in /home/pi/PiStorms
for f in 'MSDriver.sh' 'MSBrowser.sh' 'MSWeb.sh' 'SwarmServer.sh'; do sudo ln -f $b/setup/$f /etc/init.d/$f; done
for f in 'MSDriver.sh' 'MSBrowser.sh' 'MSWeb.sh' 'SwarmServer.sh'; do chmod +x $b/setup/$f; done
for f in 'ps_messenger_check.py' 'ps_updater.py'; do sudo ln -f $b/sys/$f /usr/local/bin/$f; done
sudo chmod +x /usr/local/bin/psm_shutdown
echo 'Linking done!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment