vinadoros

Members
  • Content Count

    3
  • Joined

  • Last visited

About vinadoros

  • Rank
    New User
  1. I haven't updated the script to be modern (I admit, I haven't been enthused lately to use btsync on Linux). Definitely feel free to go ahead and edit the script and repost. In fact, if you do modify the script, I would also appreciate if you sent me a pull request on GitHub to incorporate any changes you make into my original script.
  2. Thanks guys for your feedback! JimH44, thanks for your suggestion. I used Ketarin for a long time, but I never really pieced together how people used it to check versions of programs on the web. Now that you mention this process, it seems obvious . I myself am still coming to grips with regular expressions, so the pattern recognition you've given helps tremendously... In any case, I've implemented your idea in my script, and updated it on github. I did end up using wget to snag a copy of the html, and used your one-line perl script to dump the version number into the URL (pretty much the way you have it). I'll play around with the regular expression later, since I'm sure the Linux i386 glibc 2.3 version might not always be the same as the others. Also as you say, if they change the webpage in any way, I can easily see this script breaking. But until a better method comes around, this will do . Thanks!
  3. BTSync Installer Script for Linux I'm posting here an installer script for Bittorrent Sync for linux. There are several out there, but this one was created for a few specific reasons: This script would work on multiple linux distros. Packages have been made for debian/ubuntu by tuxpoldo, however there isn't a very good solution for Fedora, OpenSUSE (I believe an rpm exists for OpenSUSE, but I can't remember for sure), or other distros.No automatic solution currently creates a systemd service for autmomatically starting BTSync on startup.Few solutions allows for an easy install, uninstall, or upgrade (a notable exception is tuxpoldo's work, and it only works on debian/ubuntu based distros). This script was created to be generic, and run on any distro that supports systemd (the only reason it only supports systemd is that I don't yet have an idea about making an rc script and detecting between normal init and systemd. Contributions for that are very welcome). How to use the script: Ensure you are running a Linux Distro which is using systemd!Execute the script using the following command as a normal user.sh ./BTSync_Installer.shEnsure that no other instances of btsync are present on the system. There could be conflicts. Use the script as a normal user. Do not run the script as root unless you have a very specific reason to do so.The script creates a shortcut under either "Internet" or "Applications" depending on your system. It will load the default browser to check on the BTSync instance.The script automatically starts BTSync on startup by creating a service (using the user who installed it), and starting it up immediately.There is no password for using the web interface, you can set one up though.Ensure that you install, upgrade, or remove BTSync with the same user who performed any other operations with this script. Don't run the script as a user, and use the remove function as root. It will not work. Technical Detail of the Script: Install Mode: Checks to see if BTSync exists already. If it does not, it will get the BTsync tarball from the web, install it in /usr/local/bin, create a systemd service and run it, and create a configuration in ~/.sync/sync.conf in your home folder. It will also create a shortcut and icon in your application menu (shortcut and icon is taken from tuxpoldo's work on Github, see here: https://github.com/tuxpoldo/btsync-deb).Upgrade Mode: It only gets a version of BTSync specified in the URL fields, and replaces the version in /usr/local/bin. It doesn't do anything else.Remove Mode: It stops and removes the systemd service, removes the binary in /usr/local/bin, removes the shortcuts and icons, and at your discretion will remove your configuration. Limitations: Currently the script only works with a computer that has systemd. I tested the script on Fedora, OpenSUSE, and Debian (specifically the Siduction distribution, which had systemd running on it). It wouldn't be a tremendous effort to get it to run on sysvinit, but I'd need some help with the script in order to implement that. I can also have it run on other init systems (like Upstart), if I get some hints about how to make a service.The script runs as a normal user. This is to make the permissions of using and accessing locations through BTSync the same as the user's permissions. This can lead to odd behavior on mounted drives, which may need root permissions to access the contents. Make sure mounted drives are owned by your user, or at least give permissions for your user to read and write.Right now the URL's this script uses are hardcoded to a specific version of BTSync. Can anyone provide links to the linux versions which always point to the latest version of BTSync? Either that or some hints about how to detect the version number and insert it into the url would be helpful. Otherwise, you'll have to manually replace the URL when a new version comes out. You can find the script at https://github.com/vinadoros/btsync/blob/master/BTSync_Installer.shThe readme (much the same as this post) can be seen here: https://github.com/vinadoros/btsync Enjoy! Any feedback is appreciated.