diff options
author | Julien Dessaux | 2020-04-28 17:29:52 +0200 |
---|---|---|
committer | Julien Dessaux | 2020-04-28 17:29:52 +0200 |
commit | 6cc9d8c72a56563b6d1a12b8b441dfa9dde345e9 (patch) | |
tree | 042852f7a8a18f65c8d5191234c8ed1cb85fd8a4 /content/en/blog/miscellaneous/etc-update-alpine.md | |
parent | Initial import (diff) | |
download | www-6cc9d8c72a56563b6d1a12b8b441dfa9dde345e9.tar.gz www-6cc9d8c72a56563b6d1a12b8b441dfa9dde345e9.tar.bz2 www-6cc9d8c72a56563b6d1a12b8b441dfa9dde345e9.zip |
Long overdue first commit with content
Diffstat (limited to 'content/en/blog/miscellaneous/etc-update-alpine.md')
-rw-r--r-- | content/en/blog/miscellaneous/etc-update-alpine.md | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/content/en/blog/miscellaneous/etc-update-alpine.md b/content/en/blog/miscellaneous/etc-update-alpine.md new file mode 100644 index 0000000..dbc0824 --- /dev/null +++ b/content/en/blog/miscellaneous/etc-update-alpine.md @@ -0,0 +1,38 @@ +--- +title: "etc-update script for alpine linux" +linkTitle: "etc-update script for alpine linux" +date: 2019-04-02 +description: > + etc-update script for alpine linux +--- + +Alpine linux doesn't seem to have a tool to merge pending configuration changes, so I wrote one : +{{< highlight sh >}} +#!/bin/sh +set -eu + +for new_file in $(find /etc -iname '*.apk-new'); do + current_file=${new_file%.apk-new} + echo "===== New config file version for $current_file =====" + diff ${current_file} ${new_file} || true + while true; do + echo "===== (r)eplace file with update? (d)iscard update? (m)erge files? (i)gnore =====" + PS2="k/d/m/i? " + read choice + case ${choice} in + r) + mv ${new_file} ${current_file} + break;; + d) + rm -f ${new_file} + break;; + m) + vimdiff ${new_file} ${current_file} + break;; + i) + break;; + esac + done +done +{{< /highlight >}} + |