AMH开发软件问题?

开发软件问题

我准备开发第二个软件,发现跟以前不一样,这个没事,关键是我改好后准备初步测试,发现应用商店找不到软件,无法安装,放入了/root/amh/modules/。
更改为
ModuleSort='WEB';
ModuleType='app';

ModuleSort='server';
ModuleType='WEBServer';
均无法看见

#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin;

ModuleName='java-1.0';
ModuleSort='app';
ModuleType='WEB';
ModuleMainVersion='1';
ModuleVersion='1.0.0';
ModuleDescription='JAVA环境面板';
ModuleInstallPath=/usr/local/${ModuleName};
ModuleDate='2026-5-28';
ModuleWebSite='https://www.ymypay.cn/';
ModuleIco='logo.gif';
ModuleScriptBy='amen';

#ModuleProcessTag='java (SERVER)';
ModuleProcessFunctions='url:index.php?c=java&ModuleSort=app,cmd:stop,txt:停止|cmd:restart,txt:重启';
ModuleNotProcessFunctions='cmd:start,txt:启动';
ModuleInstallFunctions='cmd:uninstall,txt:卸载,class:red';
ModuleNotInstallFunctions='cmd:install,txt:安装|cmd:delete,txt:删除,class:red';
ModuleVid='1';

#upgrade
function amh_module_upgrade()
{
    return 0;
}

#install
function amh_module_install()
{
    if amh_module_status ; then
        return;
    else
        touch ${ModuleInstallPath}/amen;
    fi;
}

#boot
function amh_module_boot()
{
    amh_module_start;
}

#start
function amh_module_start()
{
    if amh_module_status ; then
        amh ${ModuleName} admin java_start
    else
        return 1;
    fi;
}

#stop
function amh_module_stop()
{
    if amh_module_status ; then
        amh ${ModuleName} admin java_stop
    else
        return 1;
    fi;
}

#restart
function amh_module_restart()
{
    if amh_module_status ; then
        amh ${ModuleName} admin java_restart;
    else
        return 1;
    fi;
}

#uninstall
function amh_module_uninstall()
{
    if amh_module_status ; then
        rm -rf ${ModuleInstallPath};
        echo "[OK] ${ModuleName} Uninstall successful." && return 0;
        return 1;
    else
        exit;
    fi;
}

#status
function amh_module_status()
{
    if [ -f "${ModuleInstallPath}/amen" ]; then
        echo "[OK] ${ModuleName} is already installed.";
        return 0;
    else
        echo "[Notice] ${ModuleName} is not installed.";
        return 1;
    fi;
}
阅读 629
1 个回答

可以在相应分类的软件管理菜单,查看、管理本地开发的软件。(软件商店是不显示本地开发的软件)

上面ModuleSort需要按软件商店的分类定义, 如网站(WEB),数据(DB),文件(File) 等。
把上面改为 ModuleSort='WEB'; ModuleType='app';
在『网站』分类管理菜单就看得到了。

上面仅有 /root/amh/modules/java-1.0/AMHScript,无图标。
如果有缓存,可点面板底部的『更新缓存』

另外,也可以用命令测试,
amh 软件名 install
uninstall等等,只要AMHScript有定义的都可执行响应。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题