File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,19 +84,21 @@ setup_self_restore() {
8484 backup_deb=$( find /var/cache/apt/archives/ -name " ${PACKAGE_NAME} _*.deb" -type f 2> /dev/null | sort -V | tail -1)
8585 fi
8686
87- # 3. Check /tmp/ (where Ansible downloads it )
87+ # 3. Check /tmp/ (Ansible downloads here; shadow sync SCPs as unifi-on-boot.deb )
8888 if [ -z " ${backup_deb} " ]; then
89- backup_deb=$( find /tmp/ -maxdepth 1 -name " ${PACKAGE_NAME} _*.deb" -type f 2> /dev/null | sort -V | tail -1)
89+ backup_deb=$( find /tmp/ -maxdepth 1 \( -name " ${PACKAGE_NAME} _*.deb" -o -name " ${PACKAGE_NAME} .deb " \) -type f 2> /dev/null | sort -V | tail -1)
9090 fi
9191
9292 # 4. Check common manual install locations (/root, /home)
9393 if [ -z " ${backup_deb} " ]; then
94- backup_deb=$( find /root/ /home/ -maxdepth 2 -name " ${PACKAGE_NAME} _*.deb" -type f 2> /dev/null | sort -V | tail -1)
94+ backup_deb=$( find /root/ /home/ -maxdepth 2 \( -name " ${PACKAGE_NAME} _*.deb" -o -name " ${PACKAGE_NAME} .deb " \) -type f 2> /dev/null | sort -V | tail -1)
9595 fi
9696
9797 if [ -n " ${backup_deb} " ] && [ -f " ${backup_deb} " ]; then
9898 cp " ${backup_deb} " " ${DATA_DIR} /${PACKAGE_NAME} .deb"
9999 echo " ${PACKAGE_NAME} : backed up .deb to ${DATA_DIR} (from ${backup_deb} )"
100+ # Also copy to /tmp so shadow sync and subsequent installs can find it
101+ cp " ${backup_deb} " " /tmp/${PACKAGE_NAME} .deb" 2> /dev/null || true
100102 else
101103 echo " ${PACKAGE_NAME} : WARNING: could not find .deb to backup (self-restore may need Ansible re-deploy)"
102104 fi
You can’t perform that action at this time.
0 commit comments