1 Star 0 Fork 0

codedigger_123/debian-rootfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
2-configure-rootfs.sh 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
David Robinson 提交于 2018-08-28 10:33 . Use DNS.WATCH servers
#!/bin/bash
# Check architecture and set variables
if [[ ! $check_and_set ]]; then
. 0-check-and-set.sh $1
fi
# Set hostname
filename=$build_dir/$rootfs_dir/etc/hostname
echo $arch > $filename
# DNS.WATCH servers
filename=$build_dir/$rootfs_dir/etc/resolv.conf
echo "# DNS.WATCH servers" > $filename
echo "nameserver 84.200.69.80" >> $filename
echo "nameserver 84.200.70.40" >> $filename
# Enable root autologin
filename=$build_dir/$rootfs_dir/lib/systemd/system/serial-getty@.service
autologin='--autologin root'
execstart='ExecStart=-\/sbin\/agetty'
if [[ ! $(grep -e "$autologin" $filename) ]]; then
sed -i "s/$execstart/$execstart $autologin/" $filename
fi
# Set systemd logging
filename=$build_dir/$rootfs_dir/etc/systemd/system.conf
for i in 'LogLevel=warning'\
'LogTarget=journal'\
; do
sed -i "/${i%=*}/c\\$i" $filename
done
# Enable root to connect to ssh with empty password
filename=$build_dir/$rootfs_dir/etc/ssh/sshd_config
if [[ -f $filename ]]; then
for i in 'PermitRootLogin yes'\
'PermitEmptyPasswords yes'\
'UsePAM no'\
; do
sed -ri "/^#?${i% *}/c\\$i" $filename
done
fi
echo
echo "$build_dir/`readlink $build_dir/$rootfs_dir` configured"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/codedigger_123/debian-rootfs.git
git@gitee.com:codedigger_123/debian-rootfs.git
codedigger_123
debian-rootfs
debian-rootfs
master

搜索帮助