summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorDavid Kaufmann <astra@ionic.at>2017-04-26 01:11:19 +0200
committerDavid Kaufmann <astra@ionic.at>2017-04-26 01:11:19 +0200
commita4bde9ae3273eceb125d2916baa78fd6714aa75a (patch)
tree3d98231da05e4657fa6e3535f420aae606b5fd14 /home
parent30cd159368b631d042b635264f070e19979961bb (diff)
downloadconfig-a4bde9ae3273eceb125d2916baa78fd6714aa75a.tar.gz
add config updater
Diffstat (limited to 'home')
-rwxr-xr-xhome/bin/config-update.sh25
-rw-r--r--home/var/system/config-updater/post-update1
-rw-r--r--home/var/system/config-updater/pre-update1
3 files changed, 27 insertions, 0 deletions
diff --git a/home/bin/config-update.sh b/home/bin/config-update.sh
new file mode 100755
index 0000000..a0dc1bb
--- /dev/null
+++ b/home/bin/config-update.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+URL="http://pluto.fsinf.at/~astra/config/"
+FILE="skel.tar.gz"
+
+cd ${HOME}
+
+# fetch file from server
+TMP=`mktemp -u --suffix=".tar.gz" "config-updater-XXXXXX"`
+curl -s "${URL}${FILE}" > $TMP
+
+# check if file is empty
+if [ -s $TMP ]; then
+ if [ -r ${HOME}/var/system/config-updater/pre-update ]; then
+ source ${HOME}/var/system/config-updater/pre-update
+ fi
+ tar -xzf $TMP --strip-components=1
+ if [ -r ${HOME}/var/system/config-updater/pre-update ]; then
+ source ${HOME}/var/system/config-updater/pre-update
+ fi
+else
+ echo "Could not fetch updated config, $TMP is empty"
+fi
+
+rm -f $TMP
diff --git a/home/var/system/config-updater/post-update b/home/var/system/config-updater/post-update
new file mode 100644
index 0000000..4985512
--- /dev/null
+++ b/home/var/system/config-updater/post-update
@@ -0,0 +1 @@
+rm -f this_file_will_be_deleted
diff --git a/home/var/system/config-updater/pre-update b/home/var/system/config-updater/pre-update
new file mode 100644
index 0000000..ad97a25
--- /dev/null
+++ b/home/var/system/config-updater/pre-update
@@ -0,0 +1 @@
+rm -rf .vim