9 Star 27 Fork 0

Gitee 极速下载/Webmin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/webmin/webmin
克隆/下载
changepass.pl 874 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ilia Rostovtsev 提交于 2021-04-22 19:02 +08:00 . Fix more formatting
#!/usr/local/bin/perl
# changepass.pl
# Script for the user to change their webmin password
# Get Webmin directory
my $cwd = $0;
$cwd =~ s/(.*)\/.*/$1/;
# Check command line arguments
usage() if (@ARGV != 3);
my ($config, $user, $pass) = @ARGV;
my $status = system("$cwd/bin/webmin passwd --config $config --user $user --pass $pass");
if ($status != 0) {
if ($! =~ /no such file/i) {
print "Error: Webmin CLI command cannot be found\n";
}
else {
print "Error: $!\n";
}
}
exit $status;
sub usage
{
print STDERR <<EOF;
usage: changepass.pl <config-dir> <login> <password>
This program allows you to change the password of a user in the Webmin
password file. For example, to change the password of the admin user
to foo, you would run:
- changepass.pl /etc/webmin admin foo
This assumes that /etc/webmin is the Webmin configuration directory.
EOF
exit 1;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Perl
1
https://gitee.com/mirrors/webmin.git
git@gitee.com:mirrors/webmin.git
mirrors
webmin
Webmin
master

搜索帮助