Changeset 5861849 in Klonkt
- Timestamp:
- 08/07/2026 08:42:04 AM (5 weeks ago)
- Branches:
- main
- Children:
- 4f322bc
- Parents:
- 7aa3140
- git-author:
- Robin <roboburr@…> (08/07/2026 08:41:51 AM)
- git-committer:
- roboburr <roboburr@…> (08/07/2026 08:42:04 AM)
- File:
-
- 1 edited
-
scripts/klonkt-refresh-updater.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
scripts/klonkt-refresh-updater.sh
r7aa3140 r5861849 30 30 D="${KLONKT_DIR}" 31 31 B=\$(runuser -u ${KLONKT_USER} -- git -C "\$D" rev-parse HEAD 2>/dev/null || true) 32 runuser -u ${KLONKT_USER} -- git -C "\$D" fetch --depth 1 origin ${BRANCH} 32 # Deepen a shallow checkout ONCE. \`fetch --depth 1\` keeps only the newest commit 33 # and \`checkout -f\` throws away the tree that was there, so after an update the 34 # previous version existed nowhere on the machine: a bad release could not be 35 # undone without the network, and only if you knew which commit to ask for. 36 # One deepening buys back the history; every later fetch keeps it. 37 if [ "\$(runuser -u ${KLONKT_USER} -- git -C "\$D" rev-parse --is-shallow-repository 2>/dev/null)" = "true" ]; then 38 echo "deepening the checkout once so updates can be rolled back..." 39 runuser -u ${KLONKT_USER} -- git -C "\$D" fetch --unshallow origin ${BRANCH} || true 40 fi 41 runuser -u ${KLONKT_USER} -- git -C "\$D" fetch origin ${BRANCH} 33 42 runuser -u ${KLONKT_USER} -- git -C "\$D" checkout -qf -B ${BRANCH} FETCH_HEAD 34 43 A=\$(runuser -u ${KLONKT_USER} -- git -C "\$D" rev-parse HEAD) … … 54 63 else 55 64 echo "Klonkt updated (\$A) + restarted \$N instance(s)." 65 fi 66 # History alone is not a rollback; at three in the morning you also need the 67 # command. Print it while the previous commit is still known. 68 if [ -n "\$B" ]; then 69 echo 70 echo "Previous version: \$B" 71 echo "To go back:" 72 echo " runuser -u ${KLONKT_USER} -- git -C \$D checkout -qf -B ${BRANCH} \$B" 73 echo " then restart the instances (systemctl restart 'klonkt@*')" 56 74 fi 57 75 EOF
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)