Skip to content

Instantly share code, notes, and snippets.

@hrkt
Created February 27, 2015 15:35
Show Gist options
  • Save hrkt/790ae7f4628cfbe0cb22 to your computer and use it in GitHub Desktop.
Save hrkt/790ae7f4628cfbe0cb22 to your computer and use it in GitHub Desktop.
Try rhino-shell as login shell
#!/bin/sh -x
rm -rf /opt/rhino
sed -i -e "s/\/opt\/rhino\/rish//g" /etc/shells
#!/bin/sh -x
RHINO_ROOT=/opt/rhino
if [ -d ${RHINO_ROOT} ]; then
echo "sorry! there's already ${RHINO_ROOT}"
exit 1
fi
if [ -f /tmp/rhino.zip ]; then
echo "sorry! there's already /tmp/rhino.zip"
exit 1
fi
mkdir -p ${RHINO_ROOT}
curl ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip > /tmp/rhino.zip
cd ${RHINO_ROOT};unzip /tmp/rhino.zip
rm /tmp/rhino.zip
echo "#!/bin/sh\njava -jar /opt/rhino/rhino1_7R2/js.jar" > ${RHINO_ROOT}/rish
chmod +x /opt/rhino/rish
echo /opt/rhino/rish >> /etc/shells
echo "\nrhino shell is ready at /opt/rhino/rish."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment