aboutsummaryrefslogtreecommitdiff
path: root/scripts/.fonctions
diff options
context:
space:
mode:
authormagikcypress <cyp@rouquin.me>2017-04-10 21:13:13 +0200
committermagikcypress <cyp@rouquin.me>2017-04-10 21:13:13 +0200
commit8d7554947196a67cb297a807d84aeba8f7dc0946 (patch)
treef0eb1b37b81cf8d8a735bb5183f3a7651b742e90 /scripts/.fonctions
parent4dfe2759421883575d4a63d2879d58b93bc56f6a (diff)
downloadmastodon_ynh-8d7554947196a67cb297a807d84aeba8f7dc0946.tar.gz
mastodon_ynh-8d7554947196a67cb297a807d84aeba8f7dc0946.tar.bz2
mastodon_ynh-8d7554947196a67cb297a807d84aeba8f7dc0946.zip
[fix] Add release mastodon 1.1.1
Diffstat (limited to 'scripts/.fonctions')
-rw-r--r--scripts/.fonctions30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/.fonctions b/scripts/.fonctions
index 7d9c54d..59e4f46 100644
--- a/scripts/.fonctions
+++ b/scripts/.fonctions
@@ -89,6 +89,27 @@ FIND_PORT () { # Search free port
CHECK_VAR "$port" "port empty"
}
+SETUP_SOURCE () { # Download source, decompress and copu into $final_path
+ src=$(cat ../sources/source_md5 | awk -F' ' {'print $2'})
+ sudo wget -nv -i ../sources/source_url -O $src
+ # Checks the checksum of the downloaded source.
+ # md5sum -c ../sources/source_md5 --status || ynh_die "Corrupt source"
+ # Decompress source
+ if [ "$(echo ${src##*.})" == "tgz" ]; then
+ tar -x -f $src
+ elif [ "$(echo ${src##*.})" == "zip" ]; then
+ unzip -q $src
+ else
+ false # Unsupported archive format.
+ fi
+ # Copy file source
+ sudo cp -a $(cat ../sources/source_dir)/. "$final_path/live"
+ # Copy additional file and modified
+ if test -e "../sources/ajouts"; then
+ sudo cp -a ../sources/ajouts/. "$final_path"
+ fi
+}
+
### REMOVE SCRIPT
@@ -173,6 +194,15 @@ ynh_psql_create_db() {
}
+# Drop a role
+#
+# usage: ynh_mysql_drop_role db
+# | arg: db - the database name to drop
+ynh_psql_drop_role() {
+ sudo su -c "psql" postgres <<< \
+ "DROP ROLE ${1};"
+}
+
# Drop a database
#
# usage: ynh_mysql_drop_db db