Skip to content

Commit 70cd89e

Browse files
authored
install python if not existing (#974)
1 parent b63e5e5 commit 70cd89e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

lib.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ run_main_script() {
687687
rm -f "${SCRIPTS}/${1}.php"
688688
elif curl_to_dir "${GITHUB_REPO}" "${1}.py" "$SCRIPTS"
689689
then
690-
python "${SCRIPTS}/${1}.py"
690+
python3.6 "${SCRIPTS}/${1}.py"
691691
rm -f "${SCRIPTS}/${1}.py"
692692
else
693693
print_text_in_color "$IRed" "Downloading ${1} failed"
@@ -711,7 +711,7 @@ run_static_script() {
711711
rm -f "${SCRIPTS}/${1}.php"
712712
elif curl_to_dir "${STATIC}" "${1}.py" "$SCRIPTS"
713713
then
714-
python "${SCRIPTS}/${1}.py"
714+
python3.6 "${SCRIPTS}/${1}.py"
715715
rm -f "${SCRIPTS}/${1}.py"
716716
else
717717
print_text_in_color "$IRed" "Downloading ${1} failed"
@@ -734,7 +734,7 @@ run_app_script() {
734734
rm -f "${SCRIPTS}/${1}.php"
735735
elif curl_to_dir "${APP}" "${1}.py" "$SCRIPTS"
736736
then
737-
python "${SCRIPTS}/${1}.py"
737+
python3.6 "${SCRIPTS}/${1}.py"
738738
rm -f "${SCRIPTS}/${1}.py"
739739
else
740740
print_text_in_color "$IRed" "Downloading ${1} failed"

nextcloud_update.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ then
514514
occ_command maintenance:mode --on
515515
countdown "Removing old Nextcloud instance in 5 seconds..." "5"
516516
rm -rf $NCPATH
517-
print_text_in_color "$ICyan" "Extracting new package...."
517+
print_text_in_color "$IGreen" "Extracting new package...."
518518
tar -xjf "$HTML/$STABLEVERSION.tar.bz2" -C "$HTML"
519519
rm "$HTML/$STABLEVERSION.tar.bz2"
520-
print_text_in_color "$ICyan" "Restoring config to Nextcloud..."
520+
print_text_in_color "$IGreen" "Restoring config to Nextcloud..."
521521
rsync -Aaxz $BACKUP/config "$NCPATH"/
522522
bash $SECURE & spinner_loading
523523
occ_command maintenance:mode --off
@@ -558,6 +558,7 @@ fi
558558
start_if_stopped apache2
559559

560560
# Recover apps that exists in the backed up apps folder
561+
install_if_not python3.6
561562
run_static_script recover_apps
562563

563564
# Enable Apps

static/recover_apps.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import glob, json, os, subprocess, urllib2
1+
import glob, json, os, subprocess, urllib.request
22

33
nc_path = '/var/www/nextcloud/apps/'
44
backup_path = '/var/NCBACKUP/apps/'
55
shipped_url = 'http://raw.githubusercontent.com/nextcloud/server/master/core/shipped.json'
66

7-
json_data = json.load(urllib2.urlopen(shipped_url))
7+
json_data = json.load(urllib.request.urlopen(shipped_url))
88
shipped_apps = json_data['shippedApps'] + json_data['alwaysEnabled']
99

1010
installed_dirs = set(os.path.basename(path) for path in glob.glob(backup_path + '*'))

0 commit comments

Comments
 (0)