u
This commit is contained in:
parent
20aae37be5
commit
fca8be8855
@ -53,11 +53,13 @@ then
|
|||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "=== Disallow root login: #PermitRootLogin yes"
|
if [ -e /etc/ssh/sshd_config ]
|
||||||
# emacs /etc/ssh/sshd_config
|
then
|
||||||
sed -i "s|^PermitRootLogin yes|#PermitRootLogin yes|g" /etc/ssh/sshd_config
|
echo "=== Disallow root login: #PermitRootLogin yes"
|
||||||
service sshd restart
|
sed -i "s|^PermitRootLogin yes|#PermitRootLogin yes|g" /etc/ssh/sshd_config
|
||||||
echo
|
service sshd restart
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
echo "=== Set <hostname> or <leave blank> for no change"
|
echo "=== Set <hostname> or <leave blank> for no change"
|
||||||
read -p ">>> " NewHostname
|
read -p ">>> " NewHostname
|
||||||
@ -100,18 +102,18 @@ read -p ">>> " AddNewUser
|
|||||||
if [ "$AddNewUser" == 'y' ]
|
if [ "$AddNewUser" == 'y' ]
|
||||||
then
|
then
|
||||||
source /faronear/fon/sysconfig/debian-add-user.sh $NewUser
|
source /faronear/fon/sysconfig/debian-add-user.sh $NewUser
|
||||||
fi
|
|
||||||
echo
|
|
||||||
|
|
||||||
echo "=== Enable xfce autologin [/etc/lightdm/lightdm.conf]: <y> for autologin as [$NewUser] or <anything else> for no change:"
|
echo
|
||||||
read -p ">>> " XfceAutologin
|
echo "=== Enable xfce autologin [/etc/lightdm/lightdm.conf]: <y> for autologin as [$NewUser] or <anything else> for no change:"
|
||||||
if [ "$XfceAutologin" == "y" ]
|
read -p ">>> " XfceAutologin
|
||||||
then
|
if [ "$XfceAutologin" == "y" ]
|
||||||
sed -i "s/^.*autologin-user=.*$/autologin-user=$NewUser/g" /etc/lightdm/lightdm.conf
|
then
|
||||||
sed -i "s/^.*autologin-user-timeout=.*$/autologin-user-timeout=0/g" /etc/lightdm/lightdm.conf
|
sed -i "s/^.*autologin-user=.*$/autologin-user=$NewUser/g" /etc/lightdm/lightdm.conf
|
||||||
echo "--- Successfully configured autologin as $NewUser"
|
sed -i "s/^.*autologin-user-timeout=.*$/autologin-user-timeout=0/g" /etc/lightdm/lightdm.conf
|
||||||
else
|
echo "--- Successfully configured autologin as $NewUser"
|
||||||
echo '--- Nothing changed.'
|
else
|
||||||
|
echo '--- Nothing changed.'
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
48
docker-search-tags.sh
Normal file
48
docker-search-tags.sh
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Usage:"
|
||||||
|
echo ' "this-script.sh [imageName]" to search library/[imageName]'
|
||||||
|
echo ' "this-script.sh [imageName] [ownerName]" to search [ownerName]/[imageName]'
|
||||||
|
echo ' "this.script.sh" to interactive enter [ownerName] and [imageName] to search'
|
||||||
|
echo
|
||||||
|
|
||||||
|
IMAGE=$1
|
||||||
|
while [ ! "$IMAGE" ]
|
||||||
|
do
|
||||||
|
echo "=== Enter [image name]:"
|
||||||
|
read -p ">>> " IMAGE
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
|
||||||
|
OWNER=$2
|
||||||
|
if [ ! "$OWNER" ]
|
||||||
|
then
|
||||||
|
if [ "$1" ]
|
||||||
|
then
|
||||||
|
OWNER="library"
|
||||||
|
else
|
||||||
|
echo "=== Enter [owner name] or [empty] for default 'library':"
|
||||||
|
read -p ">>> " OWNER
|
||||||
|
if [ ! "$OWNER" ]
|
||||||
|
then
|
||||||
|
OWNER="library"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== Searching $OWNER/$IMAGE ......"
|
||||||
|
echo
|
||||||
|
|
||||||
|
page_size=100
|
||||||
|
page_index=0
|
||||||
|
while true; do
|
||||||
|
page_index=$((page_index+1))
|
||||||
|
results=`curl -L -s "https://registry.hub.docker.com/v2/repositories/$OWNER/$IMAGE/tags?page=$page_index&page_size=$page_size" | jq -r 'select(.results != null) | .results[]["name"]'`
|
||||||
|
if [ $? != 0 ] || [ "$results" == "" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "$results"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo
|
Loading…
Reference in New Issue
Block a user