Fixed some errors
This commit is contained in:
12
installer.sh
12
installer.sh
@@ -22,9 +22,15 @@ install)
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
delete)
|
delete)
|
||||||
php_sys=$(cat /etc/hestia_php_selector/system/php.path)
|
if [ -e /etc/hestia_php_selector/system/php.path ]; then
|
||||||
if [ -n "$php_sys" ]; then
|
php_sys=$(cat /etc/hestia_php_selector/system/php.path)
|
||||||
update-alternatives --set php "$php_sys"
|
if [ -n "$php_sys" ]; then
|
||||||
|
update-alternatives --set php "$php_sys"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
update-alternatives --display php | grep hestiacp-php-selector
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
update-alternatives --remove php /usr/bin/hestiacp-php-selector
|
||||||
fi
|
fi
|
||||||
/usr/bin/hestiacp-php-admin remove-all
|
/usr/bin/hestiacp-php-admin remove-all
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ func setUserPhpPathVer(username string, php_ver string, php_path string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
path_to_php_config := path.Join(root_path, PATH_TO_CONFIG_NAME)
|
path_to_php_config := path.Join(root_path, PATH_TO_CONFIG_NAME)
|
||||||
f, err := os.OpenFile(path_to_php_config, os.O_WRONLY, 0400)
|
f, err := os.OpenFile(path_to_php_config, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0400)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user