mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
Update INSTALL.sh
This commit is contained in:
parent
2844cba851
commit
4ab6d4acd4
@ -536,26 +536,14 @@ install_all_locales() {
|
|||||||
|
|
||||||
|
|
||||||
check_lock_file_age() {
|
check_lock_file_age() {
|
||||||
if [ "$REPAIR" = true ]; then
|
# Use flock to create a lock or exit if the lock is already held
|
||||||
rm "$LOCK_FILE"
|
exec 200>"$LOCK_FILE"
|
||||||
# and if lock file exists
|
if flock -n 200; then
|
||||||
if [ -e "$LOCK_FILE" ]; then
|
# Inside the lock
|
||||||
local current_time=$(date +%s)
|
echo "OpenPanel installation started at: $(date)"
|
||||||
local file_time=$(stat -c %Y "$LOCK_FILE")
|
else
|
||||||
local age=$((current_time - file_time))
|
echo -e "${RED}Another instance is running. Exiting.${RESET}"
|
||||||
|
exit 1
|
||||||
if [ "$age" -ge "$INSTALL_TIMEOUT" ]; then
|
|
||||||
echo -e "${GREEN}Identified a prior interrupted OpenPanel installation; initiating a fresh installation attempt.${RESET}"
|
|
||||||
rm "$LOCK_FILE" # Remove the old lock file
|
|
||||||
else
|
|
||||||
echo -e "${RED}Detected another OpenPanel installation already running. Exiting.${RESET}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# Create the lock file
|
|
||||||
touch "$LOCK_FILE"
|
|
||||||
echo "OpenPanel installation started at: $(date)"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -563,7 +551,6 @@ check_lock_file_age() {
|
|||||||
clean_apt_cache(){
|
clean_apt_cache(){
|
||||||
# clear /var/cache/apt/archives/
|
# clear /var/cache/apt/archives/
|
||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
# TODO: cover https://github.com/debuerreotype/debuerreotype/issues/95
|
# TODO: cover https://github.com/debuerreotype/debuerreotype/issues/95
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -868,11 +855,10 @@ configure_docker() {
|
|||||||
debug_log mkdir -p $(dirname "$docker_daemon_json_path")
|
debug_log mkdir -p $(dirname "$docker_daemon_json_path")
|
||||||
|
|
||||||
if [ "$OVERLAY" = true ]; then
|
if [ "$OVERLAY" = true ]; then
|
||||||
debug_log "Setting default storage driver for Docker from to 'overlay2'.."
|
debug_log "Setting 'overlay2' as the default storage driver for Docker.."
|
||||||
cp ${ETC_DIR}docker/overlay2/daemon.json > "$docker_daemon_json_path"
|
cp ${ETC_DIR}docker/overlay2/daemon.json > "$docker_daemon_json_path"
|
||||||
###
|
|
||||||
else
|
else
|
||||||
debug_log "Changing default storage driver for Docker from 'overlay2' to 'devicemapper'.."
|
debug_log "Setting 'devicemapper' as the default storage driver for Docker.."
|
||||||
cp ${ETC_DIR}docker/devicemapper/daemon.json > "$docker_daemon_json_path"
|
cp ${ETC_DIR}docker/devicemapper/daemon.json > "$docker_daemon_json_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user