new utility: util/safemode (on or off); requires util/addons

This commit is contained in:
redmatrix 2016-06-06 16:34:10 -07:00
parent c0d80a5828
commit 82a81cd01f
2 changed files with 27 additions and 1 deletions

View file

@ -17,7 +17,6 @@ EOT;
require_once('include/cli_startup.php'); require_once('include/cli_startup.php');
cli_startup(); cli_startup();
$a = get_app();
$plugs = get_config('system', 'addon'); $plugs = get_config('system', 'addon');
$plugins_arr = array(); $plugins_arr = array();

27
util/safemode Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
if [ $# == 0 ] ; then
echo Usage: $0 on '|' $0 off
echo on saves current addons to addons-safemode and uninstalls all of them
echo off installs all addons in addons-safemode
exit
fi
if [ $1 == 'on' ] ; then
util/addons list > addons-safemode
for a in `cat addons-safemode` ; do
util/addons uninstall $a
done
exit
fi
if [ $1 == 'off' ] ; then
for a in `cat addons-safemode` ; do
util/addons install $a
done
exit
fi