From f1e7ddcf948b81b2eae5bc7c72b47f8caf13360a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 13 Oct 2016 15:04:23 -0300 Subject: Rename scripts to unisync- --- sync-all | 51 --------------------------------------------------- sync-code | 1 - sync-home | 1 - sync-irssi | 1 - sync-irssi-tor | 1 - unisync-all | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ unisync-code | 1 + unisync-home | 1 + unisync-irssi | 1 + unisync-irssi-tor | 1 + 10 files changed, 55 insertions(+), 55 deletions(-) delete mode 100755 sync-all delete mode 120000 sync-code delete mode 120000 sync-home delete mode 120000 sync-irssi delete mode 120000 sync-irssi-tor create mode 100755 unisync-all create mode 120000 unisync-code create mode 120000 unisync-home create mode 120000 unisync-irssi create mode 120000 unisync-irssi-tor diff --git a/sync-all b/sync-all deleted file mode 100755 index be8fe05..0000000 --- a/sync-all +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# sync code or home folder across systems -# - -BASENAME="`basename $0`" -DEST="$1" -UNISON="unison" - -# Use the following config if you need to sync with legacy systems -UNISON="unison" - -function sync_code_run { - local config="$1" - - if [ -z "$config" ]; then - return - fi - - if [ -f "$HOME/.unison/$config.prf" ]; then - echo "Starting sync using $config..." - $UNISON $config - else - echo "Skipping absent profile $config." - return - fi -} - -if [ ! -z "$DEST" ]; then - profiles="" - - if [ "$BASENAME" == "sync-code" ] || [ "$BASENAME" == "sync-all" ]; then - profiles="$profiles $DEST-code" - fi - - if [ "$BASENAME" == "sync-irssi" ] || [ "$BASENAME" == "sync-all" ]; then - profiles="$profiles $DEST-irssi" - fi - - if [ "$BASENAME" == "sync-irssi-tor" ] || [ "$BASENAME" == "sync-all" ]; then - profiles="$profiles $DEST-irssi-tor" - fi - - if [ "$BASENAME" == "sync-home" ] || [ "$BASENAME" == "sync-all" ]; then - profiles="$profiles $DEST-home" - fi - - for profile in $profiles; do - sync_code_run $profile - done -fi diff --git a/sync-code b/sync-code deleted file mode 120000 index 4ae0e16..0000000 --- a/sync-code +++ /dev/null @@ -1 +0,0 @@ -sync-all \ No newline at end of file diff --git a/sync-home b/sync-home deleted file mode 120000 index 4ae0e16..0000000 --- a/sync-home +++ /dev/null @@ -1 +0,0 @@ -sync-all \ No newline at end of file diff --git a/sync-irssi b/sync-irssi deleted file mode 120000 index 4ae0e16..0000000 --- a/sync-irssi +++ /dev/null @@ -1 +0,0 @@ -sync-all \ No newline at end of file diff --git a/sync-irssi-tor b/sync-irssi-tor deleted file mode 120000 index 4ae0e16..0000000 --- a/sync-irssi-tor +++ /dev/null @@ -1 +0,0 @@ -sync-all \ No newline at end of file diff --git a/unisync-all b/unisync-all new file mode 100755 index 0000000..c11837d --- /dev/null +++ b/unisync-all @@ -0,0 +1,51 @@ +#!/bin/bash +# +# sync code or home folder across systems +# + +BASENAME="`basename $0`" +DEST="$1" +UNISON="unison" + +# Use the following config if you need to sync with legacy systems +UNISON="unison" + +function sync_code_run { + local config="$1" + + if [ -z "$config" ]; then + return + fi + + if [ -f "$HOME/.unison/$config.prf" ]; then + echo "Starting sync using $config..." + $UNISON $config + else + echo "Skipping absent profile $config." + return + fi +} + +if [ ! -z "$DEST" ]; then + profiles="" + + if [ "$BASENAME" == "unisync-code" ] || [ "$BASENAME" == "unisync-all" ]; then + profiles="$profiles $DEST-code" + fi + + if [ "$BASENAME" == "unisync-irssi" ] || [ "$BASENAME" == "unisync-all" ]; then + profiles="$profiles $DEST-irssi" + fi + + if [ "$BASENAME" == "unisync-irssi-tor" ] || [ "$BASENAME" == "unisync-all" ]; then + profiles="$profiles $DEST-irssi-tor" + fi + + if [ "$BASENAME" == "unisync-home" ] || [ "$BASENAME" == "unisync-all" ]; then + profiles="$profiles $DEST-home" + fi + + for profile in $profiles; do + sync_code_run $profile + done +fi diff --git a/unisync-code b/unisync-code new file mode 120000 index 0000000..f2bc3ae --- /dev/null +++ b/unisync-code @@ -0,0 +1 @@ +unisync-all \ No newline at end of file diff --git a/unisync-home b/unisync-home new file mode 120000 index 0000000..f2bc3ae --- /dev/null +++ b/unisync-home @@ -0,0 +1 @@ +unisync-all \ No newline at end of file diff --git a/unisync-irssi b/unisync-irssi new file mode 120000 index 0000000..f2bc3ae --- /dev/null +++ b/unisync-irssi @@ -0,0 +1 @@ +unisync-all \ No newline at end of file diff --git a/unisync-irssi-tor b/unisync-irssi-tor new file mode 120000 index 0000000..f2bc3ae --- /dev/null +++ b/unisync-irssi-tor @@ -0,0 +1 @@ +unisync-all \ No newline at end of file -- cgit v1.2.3