diff options
| author | yalh76 <yalh@yahoo.com> | 2019-08-12 03:01:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-12 03:01:43 +0200 |
| commit | b9086682d2d7762d2882fff2cda4f5dceb73e32b (patch) | |
| tree | 680e9f71d54bcbe8fc3e12341ec5928d8a44e4ec /scripts/upgrade | |
| parent | 1ec1d44c6ed1daa5887367700f077286355a184f (diff) | |
| parent | be789105dad29cea8c5bec5a875695a806bb23b6 (diff) | |
| download | mastodon_ynh-b9086682d2d7762d2882fff2cda4f5dceb73e32b.tar.gz mastodon_ynh-b9086682d2d7762d2882fff2cda4f5dceb73e32b.tar.bz2 mastodon_ynh-b9086682d2d7762d2882fff2cda4f5dceb73e32b.zip | |
Merge pull request #173 from YunoHost-Apps/testing
Upgrade to 2.9.3
Diffstat (limited to 'scripts/upgrade')
| -rw-r--r-- | scripts/upgrade | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/upgrade b/scripts/upgrade index 46e7229..b35d643 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,6 +9,8 @@ source _common.sh source ynh_install_ruby source ynh_add_extra_apt_repos__3 +source ynh_add_swap +source ynh_check_ram source /usr/share/yunohost/helpers #================================================= @@ -206,6 +208,22 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # SPECIFIC UPGRADE #================================================= +# ADD SWAP IF NEEDED +#================================================= + +total_memory=$(ynh_check_ram) +total_swap=$(ynh_check_ram --only_swap) +swap_needed=0 + +if [ $total_memory -lt 2560 ]; then + # Need a minimum of 8Go of memory + swap_needed=$((2560 - $total_memory)) +fi + +ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1 +ynh_add_swap --size=$swap_needed + +#================================================= # INSTALLING RUBY AND BUNDLER #================================================= ynh_script_progression --message="Installing Ruby..." --weight=424 |
