-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_post_install_script.sh
27 lines (20 loc) · 1.06 KB
/
1_post_install_script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC1091,SC2154,SC1003,SC2005
current_dir="$(pwd)"
unypkg_script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
unypkg_root_dir="$(cd -- "$unypkg_script_dir"/.. &>/dev/null && pwd)"
cd "$unypkg_root_dir" || exit
#############################################################################################
### Start of script
small_pkgver="$(echo "$(basename "$unypkg_root_dir")" | cut -d. -f1,2)"
mkdir -pv /etc/uny/php/"$small_pkgver"
if [[ ! -f /etc/uny/php/"$small_pkgver"/php.ini ]]; then
cp -a etc/php.ini-production /etc/uny/php/"$small_pkgver"/php.ini
fi
cp -a php/php/fpm/php-fpm.service /etc/systemd/system/uny-php"$small_pkgver"-fpm.service
#sed "s|.*Alias=.*||g" -i /etc/systemd/system/uny-mariadb.service
sed -e '/\[Install\]/a\' -e 'Alias=php'"$small_pkgver"'-fpm.service' -i /etc/systemd/system/uny-php"$small_pkgver"-fpm.service
systemctl daemon-reload
#############################################################################################
### End of script
cd "$current_dir" || exit