diff options
| author | danix <danix@danix.xyz> | 2026-03-31 09:34:59 +0200 |
|---|---|---|
| committer | danix <danix@danix.xyz> | 2026-03-31 09:34:59 +0200 |
| commit | e51dcfd426d0bb475a3d12eed8d54a46b0f17444 (patch) | |
| tree | 153619df5af5632abd399a8baa51b7b9eb47a828 /syncthing/doinst.sh | |
| parent | e935183ec65007f4ae24ac41aab8dfbd15e28af4 (diff) | |
| download | my-slackbuilds-e51dcfd426d0bb475a3d12eed8d54a46b0f17444.tar.gz my-slackbuilds-e51dcfd426d0bb475a3d12eed8d54a46b0f17444.zip | |
Added some of the packages I maintain on my personal system
Diffstat (limited to 'syncthing/doinst.sh')
| -rw-r--r-- | syncthing/doinst.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/syncthing/doinst.sh b/syncthing/doinst.sh new file mode 100644 index 0000000..9d663d4 --- /dev/null +++ b/syncthing/doinst.sh @@ -0,0 +1,25 @@ +config() { + NEW="$1" + OLD="`dirname $NEW`/`basename $NEW .new`" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +config etc/logrotate.d/syncthing.new +preserve_perms etc/rc.d/rc.syncthing.new |
